Jump to content
Sign in to follow this  
dallasgfx

help me with speak function

Recommended Posts

dallasgfx

i have a code

_TalkOBJ("salut cava bien")

Func _TalkOBJ($s_text)
    Local $o_speech
    $o_speech = ObjCreate("SAPI.SpVoice")
    $o_speech.Speak ($s_text)
    $o_speech.LanguageID  = Dec ("040a")
EndFunc;==>_TalkOBJ

this function for reading a text

the problem is when i turn on the code it speak english even i"m puting this line :

$o_speech.LanguageID = Dec ("040a")

it is for speaking with frensh

plz help me

Share this post


Link to post
Share on other sites
LurchMan

i have a code

_TalkOBJ("salut cava bien")

Func _TalkOBJ($s_text)
    Local $o_speech
    $o_speech = ObjCreate("SAPI.SpVoice")
    $o_speech.Speak ($s_text)
    $o_speech.LanguageID  = Dec ("040a")
EndFunc;==>_TalkOBJ

this function for reading a text

the problem is when i turn on the code it speak english even i"m puting this line :

$o_speech.LanguageID = Dec ("040a")

it is for speaking with frensh

plz help me

try this:

_TalkOBJ("salut cava bien")

Func _TalkOBJ($s_text)
    Local $o_speech
    $o_speech = ObjCreate("SAPI.SpVoice")
    $o_speech.LanguageID  = Dec ("040a")
                $o_speech.Speak ($s_text)
EndFunc;==>_TalkOBJ

you were setting the language after it was speaking the text

This isn't tested, dont have a machine to test it with right now.

Edit: FYI: you also have to have the french language support installed for this to work.

Edited by LurchMan

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
dallasgfx

it doen"t work the scit write this as an error :

C:\Documents and Settings\Administrateur\Bureau\Nouveau AutoIt v3 Script.au3 (6) : ==> The requested action with this object has failed.:

$o_speech.LanguageID = Dec ("040a")

$o_speech.LanguageID = Dec ("040a")^ ERROR

Share this post


Link to post
Share on other sites
LurchMan

then thats not the right object. I assumed you looked it up and it was the right one. I can't remember off the top of my head what it is suppose to be. But if you change the system default to french (assuming you have that installed) then it will use the default if you use just the following code:

_TalkOBJ("salut cava bien")

Func _TalkOBJ($s_text)
    Local $o_speech
    $o_speech = ObjCreate("SAPI.SpVoice")
    $o_speech.Speak ($s_text)
EndFunc;==>_TalkOBJ

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

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  

×