我正在尝试通过SSML和.NET SpeechSynthesizer (System.Speech.Synthesis)来改变口语文本的音调。
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
PromptBuilder builder = new PromptBuilder();
builder.AppendSsml(@"C:\Users\me\Documents\ssml1.xml");
synthesizer.Speak(builder);ssml1.xml文件的内容为:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ssml:speak version="1.0"
xmlns:ssml="http://www.w3.org/2001/10/synthesis"
xml:lang="en-US">
<ssml:sentence>
Your order for <ssml:prosody pitch="+30%" rate="-90%" >8 books</ssml:prosody>
will be shipped tomorrow.
</ssml:sentence>
</ssml:speak>速度是公认的:"8本书“的发音速度比其他书慢得多,但无论”音调“设置为什么值,都没有区别!允许的值可以在这里找到:
http://www.w3.org/TR/speech-synthesis/#S3.2.4
我是不是错过了什么,或者是微软语音引擎不支持改变音调?
fritz
发布于 2011-02-13 00:51:32
虽然System.Speech使用的引擎SsmlParser接受ProcessProsody方法中的pitch属性,但它不会处理该属性。
它只处理range、rate、volume和duration属性。它也解析contour,但被作为range处理(不知道为什么)……
编辑:如果您真的不需要从SSML xml文件中读取文本,您可以通过编程创建文本。
而不是
builder.AppendSsml(@"C:\Users\me\Documents\ssml1.xml");使用
builder.Culture = CultureInfo.CreateSpecificCulture("en-US");
builder.StartVoice(builder.Culture);
builder.StartSentence();
builder.AppendText("Your order for ");
builder.StartStyle(new PromptStyle() { Emphasis = PromptEmphasis.Strong, Rate = PromptRate.ExtraSlow });
builder.AppendText("8 books");
builder.EndStyle();
builder.AppendText(" will be shipped tomorrow.");
builder.EndSentence();
builder.EndVoice();https://stackoverflow.com/questions/4977379
复制相似问题