Jump to content
Sign in to follow this  

error after compilation of script

Recommended Posts


Here is my script....

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

;Create voice and ear for jarvis here----

Global $RecoContext = ObjCreate("SAPI.SpSharedRecoContext")
If @error Then
    MsgBox(0, "", "Error opening the 'SAPI.SpSharedRecoContext' object. Error number: " & Hex(@error, 8))
$voice = ObjCreate("SAPI.Spvoice")

$GRAMMER = $RecoContext.CreateGrammar
$GRAMMER.cmdsetruleidstate(0, 1)
$event = ObjEvent($RecoContext, "event_")
$RecoContext.eventinterests = 16 + 512 + 1024
;~ Global $h_Category = ObjCreate("SAPI.SpObjectTokenCategory")
;~ $h_Category.SetId("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput\TokenEnums\MMAudioIn\")
;~ Global $h_Token = ObjCreate("SAPI.SpObjectToken")
;~ $h_Token.SetId("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput\TokenEnums\MMAudioIn\")
;~ $RecoContext.recognizer.AudioInput = $h_Token

Func event_Recognition($1, $2, $3, $4)
    $text = $4.phraseinfo.gettext()
    If $text = "exit" Then
        $RecoContext.voice.speak("Closing Sir")
    If $text = "David" Or $text = "COMPUTER" Or $text = "hey" Or $text = "chote" Or $text = "darling" Then
        $RecoContext.voice.rate = 3
;~      $RecoContext.voice.voice=$RecoContext.voice.getvoices.item(2)
        $RecoContext.voice.speak("Yes Sir")

EndFunc   ;==>event_Recognition

Func event_FalseRecognition($1, $2, $3)
    ConsoleWrite($3.phraseinfo.gettext() & @CRLF)
EndFunc   ;==>event_FalseRecognition

While 1
    ;Allow the Audio In to finalize processing on the last 5 second capture
    ;Resume audio in processing
    $event = ObjEvent($RecoContext, "event_")

Func bye()
EndFunc   ;==>bye

when..i compile this script and run the EXE file it show this Error...

Line 13 (File "C:\Documents and Settings\Administrator\Desktop\super software\speech.exe"):

Error: The requested action with this object has failed.

but it runs fine and gives no error when..i run..it through scite..i don't know why it is giving me error after compilation...

Can't think of anything...please help...

[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]

Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.