Jump to content

Recommended Posts

Posted

My Code:

Run("notepad.exe", @SystemDir, @SW_MAXIMIZE)

Global $RecoContext
$RecoContext = ObjCreate("SAPI.SpSharedRecoContext")
$Grammar = $RecoContext.CreateGrammar(1)
$SinkObject=ObjEvent($RecoContext,"Event_")
$Grammar.Dictationload
$Grammar.DictationSetState(1)
while 1
WinWaitActive("Untitled - Notepad")
While WinActive("Untitled - Notepad")
  Sleep(10)
Wend
WEnd
Exit 

Func Event_Recognition($StreamNumber,$StreamPosition,$RecognitionType,$Result) 
    $t = $Result.PhraseInfo.GetText
    If $t = "select all" Then
        Send("^a")
    ElseIf $t = "backspace" Then
        Send("{BACKSPACE}")
    Else
        Send($t, 1)
    EndIf
EndFunc

The Error:

>"C:\Program Files\AutoIt3\SciTE\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "C:\Documents and Settings\Owner\My Documents\AutoIthelp\speech_test.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams

>Running AU3Check C:\Program Files\AutoIt3\SciTe\Defs\Unstable\Au3Check\au3check.dat

>AU3Check Ended. No Error(s).

>Running: (3.1.1.119):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Documents and Settings\Owner\My Documents\AutoIthelp\speech_test.au3"

C:\Documents and Settings\Owner\My Documents\AutoIthelp\speech_test.au3 (5) : ==> Variable must be of type "Object".:

$Grammar = $RecoContext.CreateGrammar(1)

$Grammar = $RecoContext^ ERROR

>AutoIT3.exe ended.

>Exit code: 0 Time: 1.427

Latest Beta: 3.1.1.119

#)

  • 1 month later...
Posted

Sorry for the very late reply... But it appears that my speech engines are corrupted (according to several error messages).

Installing SR did not work.

Hope anyone can help.

#)

nfwu,

I ran into problems with sapi problems today also on a Win2k laptop.

I downloaded the 68Mb SpeechSDK51.exe from the following link and now it works.

http://www.microsoft.com/downloads/details...&DisplayLang=en

I hope this works for you also.

taurus905

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Posted (edited)

Ouch...I didn't see that.

i542

Edited by i542

I can do signature me.

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
×
×
  • Create New...