.net 使用System.Speech.Synthesis.SpeechSynthesizer将文本转换为MP3
我正在尝试将文本转换为语音以保存到MP3。 目前我有System.Speech.Synthesis可以很好地与WAV文件对话.net 使用System.Speech.Synthesis.SpeechSynthesizer将文本转换为MP3,.net,mp3,text-to-speech,speechsynthesizer,.net,Mp3,Text To Speech,Speechsynthesizer,我正在尝试将文本转换为语音以保存到MP3。 目前我有System.Speech.Synthesis可以很好地与WAV文件对话 With New System.Speech.Synthesis.SpeechSynthesizer '.SetOutputToWaveFile(pOutputPath) This works fine .SetOutputToWaveStream(<<Problem bit>>) .
With New System.Speech.Synthesis.SpeechSynthesizer
'.SetOutputToWaveFile(pOutputPath) This works fine
.SetOutputToWaveStream(<<Problem bit>>)
.Speak(pTextToSpeak)
.SetOutputToNull()
.Dispose()
End With
让语音合成器写入WAV,然后转换成MP3,最后放在HDD上。我认为除了使用WAV写入,然后使用LAME MP3编码器(等等)转换外,没有其他方法。只需摆弄雪人,它确实有效,我在一个相当大的web应用程序上使用了它,它已经无问题运行了大约2年。首先,让Yeti类提供一个具有适当压缩因子的可写流。然后,使用-告诉TTS引擎有关语音质量的信息。是的,好的,我会尝试一下,尽管我希望有一个更优雅的解决方案,所以我暂时不讨论它。
.SetOutputToWaveStream(New MP3WriteStream(pOutputPath))