WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: stanl on September 20, 2020, 03:29:18 AM

Title: CLR - Speech Synthesizer
Post by: stanl on September 20, 2020, 03:29:18 AM
Code (WINBATCH) Select


;Winbatch 2020a - testing CLR Speech Synthesizer
myWav = "C:\temp\test.wav"
ObjectClrOption('useany', 'System')
ObjectClrOption('useany', 'System.Speech')
oSpeech =  ObjectClrNew('System.Speech.Synthesis.SpeechSynthesizer')
oSpeech.SetOutputToDefaultAudioDevice()
oSpeech.Volume = 90
oSpeech.Speak("What is your favorite color?")
oSpeech.SetOutputToWaveFile(myWav)
oSpeech.Speak("In case you didn't hear me, I've saved this - so - What is your favorite color?")
oSpeech.Dispose()
oSpeech =0


If FileExist(myWav) Then Message("Audio File Created",myWav)
Exit


Title: Re: CLR - Speech Synthesizer
Post by: bottomleypotts on October 05, 2022, 02:13:47 PM
Just looking at what else CLR can do. This may be handy for another project. Wondering why this no longer works? Error 1261: COM/CLR Exception
Title: Re: CLR - Speech Synthesizer
Post by: stanl on October 05, 2022, 03:33:24 PM
still works for me.
Title: Re: CLR - Speech Synthesizer
Post by: td on October 05, 2022, 05:47:36 PM
Works for me too...
Title: Re: CLR - Speech Synthesizer
Post by: bottomleypotts on October 05, 2022, 07:19:45 PM
Hmmm. Windows 10 out of the box?? Or do I need to add something else?