HELP!!!,
I currently am using the following code for tts in my async multichannel application...
Works great with normal SAPI voices, but when I try and use hi-quality TTS Voices (neospeech Julie, for example) , the tts conversion seems to be slow. This creates an undesirable lag. I think if the tts audio stream was routed directly to Diva, the lag would be eliminated.
I read that DivaSendVoiceEx can read audio from memory with the DivaVoiceDataSourceMemory option, but see no documentation on it's implementation.
(It would be great to modify the attached VB NETcode as an example:)
Thanks.
Private Sub Talk(ByVal SpeechText As String)
Dim retVal As DIVASDKLib.DivaResultCodes
Using SAPI As New System.Speech.Synthesis.SpeechSynthesizer Dim formatInfo As System.Speech.AudioFormat.SpeechAudioFormatInfo = New System.Speech.AudioFormat.SpeechAudioFormatInfo(8000, System.Speech.AudioFormat.AudioBitsPerSample.Eight, System.Speech.AudioFormat.AudioChannel.Mono) SAPI.SetOutputToWaveFile( "C:\wav1.wav", formatInfo)
SAPI.SetOutputToWaveFile(
SAPI.Speak(SpeechText)
SAPI.SetOutputToDefaultAudioDevice()
End Using Dim Digit As Object = Nothing retVal = MyCall.SendVoiceFilesEx("C:\wav1.wav", "0123456789*#" , Digit, DivaAudioFmt.DivaAudioWav_PCM_8K16BitMono, 0, 0) MyCall.WaitAsyncComplete(0) End Sub
DivaSendVoiceEx is a function from the lower level C/C++ API and isn't implmented in the VB API, mainly because many channels of memory streaming may cause performance issues when using VB.
To use memory streaming with VB apps you should look at the audio provider interface as demonstrated in the VisualBasic .Net sample "Simplephone".
This uses another sample, the C sample audio provider APSoundDevice to connect to the audioprovider, in this case the sound card of the pc. You could use a similar technique to connect to SAPI but I don't have any direct samples on how to do this.