Jump to content

Sapi Problem...


nfwu
 Share

Recommended Posts

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

#)

Link to comment
Share on other sites

That must mean you either don't have the SR installed, get it here

or it is installed but you never trained it, train it for one session.

let me know if that helped

Edited by zerocool60544

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

  • 1 month later...

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.

#)

Link to comment
Share on other sites

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

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...