如何把 public string GenerateTextToSpeechstring speaker string _msg string format float length float noise float noisew float sdp_ratio string urlParams = stringFormatspeaker=0&text=1&forma
你可以将原始代码改为以下样式:
public string GenerateTextToSpeech(string lang, string name, string style, int styleDegree, string text)
{
string xml = string.Format(@"<speak version=""1.0"" xmlns=""http://www.w3.org/2001/10/synthesis""
xmlns:mstts=""https://www.w3.org/2001/mstts"" xml:lang=""{0}"">
<voice name=""{1}"">
<mstts:express-as style=""{2}"" styledegree=""{3}"">
{4}
</mstts:express-as>
</voice>
</speak>", lang, name, style, styleDegree, text);
return xml;
}
请注意,在修改后的代码中,参数的名称和顺序已经改变。现在,你需要提供语言(lang)、名称(name)、样式(style)、样式程度(styleDegree)和文本(text)作为输入参数,并返回一个XML字符串。
原文地址: http://www.cveoy.top/t/topic/i9CO 著作权归作者所有。请勿转载和采集!