I use Microsoft TTS to speak the text, it work fine with this
example. but I want to use TTS to generate the Wav file.
I found this can be achived by VB examples from Microsoft Speech SDK 5.1 which I download from Microsoft website.
the part of core code like this:
' create a wave stream
Dim cpFileStream As New SpFileStream
' Set output format to selected format
cpFileStream.Format.Type = FormatCB.ItemData(FormatCB.ListIndex)
' Open the file for write
cpFileStream.Open ComDlg.FileName, SSFMCreateForWrite, False
' Set output stream to the file stream
Voice.AllowAudioOutputFormatChangesOnNextSet = False
Set Voice.AudioOutputStream = cpFileStream
' show action
AddDebugInfo "Save to .wav file"
' speak the given text with given flags
Voice.Speak MainTxtBox.Text, m_speakFlags
' wait until it's done speaking with a really really long timeout.
' the tiemout value is in unit of millisecond. -1 means forever.
Voice.WaitUntilDone -1
' Since the output stream was set to the file stream, we need to
' set back to the selected audio output by calling AudioOutputCB_Click
' as if user just changed it through UI
AudioOutputCB_Click
' close the file stream
cpFileStream.Close
Set cpFileStream = Nothing
MsgBox "WAV file successfully written!", vbOKOnly, "File Saved"
From above, the red mark is no use at LabVIEW, you can see from my attachment below
So maybe I make some mistakes from the example, I hope someone can point out for me, Thanks a lot
QIA
http://www.vitst.com
Virry Test & Control
LabVIEW Certified Developer