问题描述
调用SpeakSsmlAsync(Microsoft Speech SDK)时,返回以下错误消息:
CANCELED:
Reason=Error,ErrorCode=NoError,ErrorDetails=[USP error,timeout to get the first audio chunk.]
using (var stream = AudioOutputStream.CreatePushStream(callback))
{
// Creates a speech synthesizer using audio stream output.
using (var streamConfig = AudioConfig.FromStreamOutput(stream))
{
using (var synthesizer = new SpeechSynthesizer(config,streamConfig))
{
// Receives a text from console input and synthesize it to pull audio output stream.
using (var result = await synthesizer.SpeakSsmlAsync(text))
{
if (result.Reason == ResultReason.SynthesizingAudioCompleted)
{
logger.Info($"Speech synthesized for text [{text}],and the audio was written to output stream.");
}
else if (result.Reason == ResultReason.Canceled)
{
var cancellation = SpeechSynthesisCancellationDetails.FromResult(result);
if (cancellation.Reason == CancellationReason.Error)
{
Console.WriteLine($"CANCELED: Reason={cancellation.Reason}," +
$"ErrorCode={cancellation.ErrorCode}," +
$"ErrorDetails=[{cancellation.ErrorDetails}]");
}
}
}
}
}
}
参数中的ssml文本:“ MerhabaDünya”。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)