Massyn has asked for the wisdom of the Perl Monks concerning the following question:
#!/fellow/monks.pl
I've been using Microsoft TTS within perl for quite some time, however, I've never been able to get it to dump the speech into a WAV file, rather than playing out on the sound card. The idea is to pass this to a voice modem application.
Any ideas on how to do it would be greatly appreciated.
This is the code I'm currently using
sub talk { local $txt = $_[0]; use Win32::OLE; local $voice = Win32::OLE->new("Speech.VoiceText") or die("TTS + failed"); $voice->Register("", "$0"); $voice->{Enabled} = 1; # optional $voice->Speak($txt, 1); while ($voice->IsSpeaking()) { sleep 1; } }
Thanks!
#!/massyn.pl The early worm gets caught by the bird.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text-to-Speech in WAV
by PodMaster (Abbot) on Apr 02, 2003 at 06:58 UTC |