Jump to content
Sign in to follow this  

Problem with speech recognition

Recommended Posts


hello need help to understand error with the object com SAPI

here the code:

$RecoContext = ObjCreate("SAPI.SpSharedRecoContext")

$SinkObject = ObjEvent($RecoContext, "MYEvent_")

;GUICtrlSetData($GUIEdit, "ObjEvent created Successfully!" & @CRLF, "append")

;Imported from: SAPI.H


Const $SPRS_ACTIVE = 1



$Grammar = $RecoContext.CreateGrammar(0)




$prulec = $prules.Add( "wordsRule", 0x01 + 0x20,0)


$pstate = $prulec.InitialState

$pstate.AddWordTransition ("","One");

so i dont understand the error i have on the last line

C:\autoitrecon.au3 (42) : ==> The requested action with this object has failed.:

$pstate.AddWordTransition ("","One")

$pstate.AddWordTransition ("","One")^ ERROR

i have read the SDK and some samples already written in other langage ..but dont understand

maybe an autoit problem?

Edited by Frenchy

Share this post

Link to post
Share on other sites

Hum i have trapped th eror code and its mismatch...???

so the method AddWordTransition could have Null pointer as first argument..? is it the error???

definition in help sdk is

     DestinationState As ISpeechGrammarRuleState,
     Words As String,
     [Separators As String = " "],
     [Type As SpeechGrammarWordType = SGLexical],
     [PropertyName As String = ""],
     [PropertyId As Long = 0],
     [PropertyValue As Variant = 0],
     [Weight As Single = 1.0]
Edited by Frenchy

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.