我想知道是否有办法将文本转语音数据保存为 mp3 或 Wav 文件格式以便稍后播放?
SpeechSynthesizer reader = new SpeechSynthesizer();
reader.Rate = (int)-2;
reader.Speak("Hello this is an example expression from the computers TTS engine in C-Sharp);
我正在尝试将其保存在外部,以便稍后播放。做这个的最好方式是什么?
最佳答案
有multiple options例如保存到现有流。如果你想创建一个新的 WAV 文件,你可以使用 SetOutputToWaveFile方法。
reader.SetOutputToWaveFile(@"C:\MyWavFile.wav");
关于C# 将文本转语音保存到MP3文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16021302/