No announcement yet.

SAPI Creating WAV file

  • Filter
  • Time
  • Show
Clear All
new posts

  • Calvin H. Chipman
    I was looking for the same thing and couldn't find it, so I created the solution and posted here:

    Leave a comment:

  • Bill Roe
    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

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

    Leave a comment:

  • Bill Roe
    started a topic SAPI Creating WAV file

    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?