kahlil88 Posted March 1, 2009 Share Posted March 1, 2009 Mac OS X comes with a command line text-to-speech program called say. Is this program, or one just like it, available for Windows? Link to comment Share on other sites More sharing options...
DigeratiPrime Posted March 1, 2009 Share Posted March 1, 2009 Sam or Anna?http://en.wikipedia.org/wiki/Microsoft_Samhttp://en.wikipedia.org/wiki/Microsoft_Anna Link to comment Share on other sites More sharing options...
MHz Posted March 1, 2009 Share Posted March 1, 2009 You can use VBScript or AutoIt 3 to access the SAPI object.Here is a AutoIt example that can be compiled to say.exe and use a CLI switch to run it i.e. say.exe "this is a test parameter". The VBScript syntax is similar to translate to.If $CMDLINE[0] = 1 Then ; call function using cli parameter _Say($CMDLINE[1], 1, 100)Else ; else call function with a warning _Say('No parameters used')EndIfFunc _Say($sText, $iRate = 1, $iVolume = 100) ; use sapi text to speech If $iRate > 10 Or $iVolume > 100 Then Return Local $oTalk = ObjCreate('SAPI.SpVoice') If Not @error Then With $oTalk .Rate = $iRate .Volume = $iVolume .Speak($sText, 1) .WaitUntilDone(500) .Pause() Sleep(1000) .Resume() .WaitUntilDone(-1) EndWith EndIfEndFunc Link to comment Share on other sites More sharing options...
kahlil88 Posted March 4, 2009 Author Share Posted March 4, 2009 Sam or Anna?http://en.wikipedia.org/wiki/Microsoft_Samhttp://en.wikipedia.org/wiki/Microsoft_AnnaThe Wikipedia articles are a bit skimpy. Can I run these from the command line the same way I run say? I mostly want to use it for goofing around (i.e. making my computer tell mom jokes or praising GNU/Linux operating systems ). Link to comment Share on other sites More sharing options...
Tripredacus Posted March 5, 2009 Share Posted March 5, 2009 You can use VBScript or AutoIt 3 to access the SAPI object.Here is a AutoIt example that can be compiled to say.exe and use a CLI switch to run it i.e. say.exe "this is a test parameter". The VBScript syntax is similar to translate to.If $CMDLINE[0] = 1 Then ; call function using cli parameter _Say($CMDLINE[1], 1, 100)Else ; else call function with a warning _Say('No parameters used')EndIfFunc _Say($sText, $iRate = 1, $iVolume = 100) ; use sapi text to speech If $iRate > 10 Or $iVolume > 100 Then Return Local $oTalk = ObjCreate('SAPI.SpVoice') If Not @error Then With $oTalk .Rate = $iRate .Volume = $iVolume .Speak($sText, 1) .WaitUntilDone(500) .Pause() Sleep(1000) .Resume() .WaitUntilDone(-1) EndWith EndIfEndFuncI had previously used the Text to Speech UDF available on Autoit forums in a QC application. It does work but were some bugs iirc. Link to comment Share on other sites More sharing options...
MHz Posted March 14, 2009 Share Posted March 14, 2009 I had previously used the Text to Speech UDF available on Autoit forums in a QC application. It does work but were some bugs iirc.Sorry for late reply. I would like to comment that using XP 32 bit I had no problems at all with scripting SAPI with AutoIt or VBScript. Under Vista 32 Bit is little joy as the sound drivers that I have are not good in certain sound generation methods used. I use the Creative card and drivers that are not quite there yet for the card that i have. Perhaps some similar issues is your recognition of disappointment with using scripts to using SAPI? Link to comment Share on other sites More sharing options...
Tripredacus Posted March 16, 2009 Share Posted March 16, 2009 I had previously used the Text to Speech UDF available on Autoit forums in a QC application. It does work but were some bugs iirc.Sorry for late reply. I would like to comment that using XP 32 bit I had no problems at all with scripting SAPI with AutoIt or VBScript. Under Vista 32 Bit is little joy as the sound drivers that I have are not good in certain sound generation methods used. I use the Creative card and drivers that are not quite there yet for the card that i have. Perhaps some similar issues is your recognition of disappointment with using scripts to using SAPI?For me, the UDF by itself was not a good enough problem. I eventually disabled that feature of my program because it had certain memory leaks. For example, sometimes it would play sound, sometimes it would lock up the computer or the sound would skip. It was because my program did not give the ability to stop playing the audio, so there was no control of it. Another thing, you couldn't close my program until the sound stopped playing, or end process caused instability or sound wouldn't work anymore until a reboot. I do not have the source code handy that I used, it has been archived to DVD a while ago. Link to comment Share on other sites More sharing options...
jaclaz Posted March 16, 2009 Share Posted March 16, 2009 "Say" port to Win32 (sort of):http://krolik.net/post/Say-exe-a-simple-co...or-Windows.aspxjaclaz Link to comment Share on other sites More sharing options...
kahlil88 Posted April 16, 2009 Author Share Posted April 16, 2009 "Say" port to Win32 (sort of):http://krolik.net/post/Say-exe-a-simple-co...or-Windows.aspxYeah! That's exactly what I was looking for! 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