我在一个使用Microsoft.Speech.Synthesis合成器的应用程序中工作。我在试着用西班牙语发音(埃斯-埃斯,海伦娜)。代码如下:
using Microsoft.Speech.Synthesis;
...
...
//Inside main method
SpeechSynthesizer synth = new SpeechSynthesizer();
List<InstalledVoice> installedVoices = new List<InstalledVoice>();
foreach (InstalledVoice voice in synth.GetInstalledVoices()){
installedVoices.Add(voice);
Console.WriteLine(voice.VoiceInfo.Name);
}
synth.SelectVoice(installedVoices[0].VoiceInfo.Name);
synth.Rate = 0;
synth.TtsVolume = 100;
synth.SpeakAsync("Hola Mundo");
Console.WriteLine();
Console.ReadKey();控制台中的输出如下:
Microsoft Server Speech Text to Speech Voice (es-ES,Helena)
问题是程序不会说话。我听不到音频。有人能帮我这个忙吗?
感谢所有的帮助。
发布于 2016-05-07 05:14:18
您似乎错过了输出设置。
// Configure the synthesizer to send output to the default audio device.
synth.SetOutputToDefaultAudioDevice();这会将输出设置为系统的默认音频设备。
发布于 2020-04-16 01:21:00
我也有同样的问题,一切都安装正确,输出设置为DefaultAudioDevice,但仍然没有声音。
出于某种原因,我解决这个问题的方法是将我的音频从5.1设置为立体声。也许是因为我戴了耳机。
https://stackoverflow.com/questions/37079898
复制相似问题