【发布时间】:2020-11-24 14:40:55
【问题描述】:
所以我正在尝试编写一个文本到语音的程序,它会逐渐变得更快,在句子之间留下更少的间隙,并最终过度分层并同时运行多个命令,这样它就变成了一堆杂音。它目前是一个控制台应用程序,我有相关的参考资料
我如何调整它以将每个语音命令作为自己的实例运行的任何想法。我是否必须重新学习如何使用多线程才能使其工作?
任何帮助都会很棒,在它循环的那一刻(迭代次数不是太重要),我试图在每个循环之后减少停顿,但无法让一个说话命令覆盖前面的内容。
for (int i = 0; i < 100; i++)
{
if (Console.KeyAvailable == true)
{
break;
}
else
{
if (i == 0)
{
string commandLine2 = "Hello darkness my old friend";
SpeechSynthesizer s = new SpeechSynthesizer();
s.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Child);
s.Speak(commandLine2);
commandLine2 = "Its been a while where should we begin";
//Thread.Sleep(1000);
s.Speak(commandLine2);
}
else
{
string commandLine2 = "Hello darkness my old friend";
SpeechSynthesizer s = new SpeechSynthesizer();
s.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Child);
s.Speak(commandLine2);
commandLine2 = "Its been a while where should we begin";
//Thread.Sleep(1000 / i);
s.Speak(commandLine2);
}
}
}
【问题讨论】:
-
所以重叠是目标,还是您要修复的错误?它现在的行为如何,以相等的间隔说话?
-
重叠是目标,目前只是说完一句话后才说要造成重叠。是的,使用那个类,不知道其他人
标签: c# text-to-speech speech-synthesis speechsynthesizer