SpeechSynthesizer in C# creates wav that has 22kHz... needs to be 16kHz
Posted
by Adrian
on Stack Overflow
See other posts from Stack Overflow
or by Adrian
Published on 2010-04-12T21:31:19Z
Indexed on
2010/04/12
21:32 UTC
Read the original article
Hit count: 443
My C# application needs to covert text to wav file and inject it into a Skype call. The code that creates the wav file is below. The problem is that the file has 22kHz sample rate and Skype accepts only 16kHz.
Is there any way to adjust this setting?
using (System.IO.FileStream stream = System.IO.File.Create("message.wav"))
{
System.Speech.Synthesis.SpeechSynthesizer speechEngine = new System.Speech.Synthesis.SpeechSynthesizer();
speechEngine.SetOutputToWaveStream(stream);
speechEngine.Speak(number);
stream.Flush();
}
© Stack Overflow or respective owner