Thank you Ward ! You're my hero of the week !

I also got speech to wav file working. Here's that code snippet:
    
    
    var ttsStream = CreateObject("SAPI.SpFileStream")
      ttsStream.Open("nimtts.wav", 3)  # 3 is Create File (overwrites existing)
      var ttswav = CreateObject("SAPI.SpVoice")
      ttswav.setRef("AudioOutputStream", ttsStream)
      ttswav.speak "Nim, Windows text to speech test to a wav file", 3
      # wait for tts to wav to finish, but not longer than 10 seconds
      # note that output to wav is much much faster than actually 'speaking' to 
audio device
      ttswav.WaitUntilDone(10000)
      ttsStream.Close()
    
    
    Run

Feel free to alter and include in your winim sample if you want. 

Reply via email to