SpeechSynthesizer sometimes plays speech depending on SpeechSynthesisOutputFormat
In a C# WPF application, I call this function to convert text to speech:
SpeechSynthesisResult speechSynthesisResult = await speechSynthesizer.SpeakSsmlAsync(strSsml);
The audio data is returned ok. BUT the function also sometimes plays the speech as well through my sound device, depending on which output format is selected.
Raw24Khz16BitMonoPcm
<- Automatically plays the speech audio.
Audio24Khz160KBitRateMonoMp3
<- Does not play the speech audio.
I need the automatic speech out to stop, but I also need the audio data in WAV file format.
My configuration looks like this:
`SpeechConfig speechConfig = SpeechConfig.FromSubscription(SubscriptionKey, SubscriptionRegion);`
speechConfig.OutputFormat = OutputFormat.Detailed;
speechConfig.SetSpeechSynthesisOutputFormat(Raw24Khz16BitMonoPcm);
speechConfig.SpeechSynthesisVoiceName = "en-GB-LibbyNeural";
speechConfig.SetProperty(PropertyId.Speech_LogFilename, "[FILE ON MY HARD DISK]");
Thanks for reading.