viewpoint-particle

Author Topic: CLR - Speech Synthesizer  (Read 128 times)

stanl

  • Pundit
  • *****
  • Posts: 1422
CLR - Speech Synthesizer
« on: September 20, 2020, 03:29:18 am »
Code: Winbatch

;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