XY16 Posted May 9, 2011 Share Posted May 9, 2011 hi guys, check out this little udf. it's not much, but at least it's not just sapi. ;speech udf ;uses either sapi or google speech. ;function ;name: _SpeechGet ;description: generates speech and outputs it to the speakers. ;usage: _SpeechGet($Text, $Engine) ;$Text = the text to speak. ;$Engine = the speech engine to use, 0 = microsoft speech API 5x, 1 = Google translation API. 0 is default. ;returns 0 if no errors, 1 for errors. Func _SpeechGet($Text, $Mode = "0") if $Text = "" then Return 1 if $Mode > 1 or $Mode < 0 then Return 1 if $Mode = "0" then ;create speech object Local $Voice = ObjCreate("Sapi.SpVoice") if not IsObj($Voice) then Return 1 EndIf if $Mode = "0" then ;speak the text $Voice.Speak($Text) Return 0 else ;use the google translation api to get the speech InetGet("http://translate.google.com/translate_tts?q=" & $Text, @TempDir & "\tempspeech.mp3", 1) ;play the downloaded speech SoundPlay(@TempDir & "\tempspeech.mp3", 1) ;delete the temporary file FileDelete(@TempDir & "\tempspeech.mp3") Return 0 EndIf EndFunc let me know if you enjoy it, or if you know of any other web based speech services i could add support for. kid1232 1 Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16 Link to comment Share on other sites More sharing options...
kid1232 Posted August 30, 2013 Share Posted August 30, 2013 Tks friend, but you should fix when get other language sound Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 30, 2013 Moderators Share Posted August 30, 2013 kid1232 please do not resurrect old threads, especially when not adding anything benefiicial. If you had bothered to look you would see that the OP has not been active on the forum in two years. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
EKY32 Posted August 30, 2013 Share Posted August 30, 2013 Tks friend, but you should fix when get other language sound >This is a perfect example. [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now