Jump to content

Speech Recognition Problem


 Share

Recommended Posts

i was just playing with microsoft speech recognition library....here is my code...!

$RecoContext=ObjCreate("SAPI.SpSharedRecoContext")
if @error then
    Msgbox(0,"","Error opening the 'SAPI.SpSharedRecoContext' object. Error number: " & hex(@error,8))
    exit
endif
$voice=ObjCreate("SAPI.Spvoice")

$GRAMMER=$RecoContext.CreateGrammar
$GRAMMER.cmdloadfromfile("test.xml")
$GRAMMER.cmdsetruleidstate(0,1)
$event=ObjEvent($RecoContext,"event_")
MsgBox(0,'','now speak')

Func event_Recognition($1,$2,$3,$4)
    $text=$4.phraseinfo.gettext()
    MsgBox(0,'',$text)
EndFunc


While 1
    Sleep(10000)
WEnd

there are only three word that it recognises--Piyush,Play Music,Play Game

as i speak in the microphone..it recognises for almost the sleep time..ie 10 sec...after that it stops recognition..i don't what is happening..i think it is due to the while loop after 10 secs the loop continues and recogntion stops!!

please help me out

[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...