Announcement

Collapse
No announcement yet.

SAPI Creating WAV file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SAPI Creating WAV file

    Using SAPI 5.1 and the sample posted by Jose, it was very easy to use text to speech. Is there an example of saving the output to a WAV file instead of "speaking" it?

  • #2
    VB Example

    'Here is a VB example that I'm trying (unsuccessfully) to convert.
    'Any pointers would be helpful

    Dim FileName As String
    Dim FileStream As New SpFileStream
    Dim Voice As SpVoice

    'Create a SAPI voice
    Set Voice = New SpVoice

    'The output audio data will be saved to ttstemp.wav file
    FileName = “c:\ttstemp.wav"

    'Create a file; set DoEvents=True so TTS events will be saved to the file
    FileStream.Open FileName, SSFMCreateForWrite, True

    'Set the output to the FileStream
    Set Voice.AudioOutputStream = FileStream

    'Speak the text
    Voice.Speak “hello world”

    'Close the Stream
    FileStream.Close

    'Release the objects
    Set FileStream = Nothing
    Set Voice = Nothing

    Comment


    • #3
      I was looking for the same thing and couldn't find it, so I created the solution and posted here:

      http://www.powerbasic.com/support/pb...d.php?p=432160

      Comment

      Working...
      X