【发布时间】:2020-06-24 21:32:18
【问题描述】:
我正在使用来自https://github.com/Azure-Samples/cognitive-services-speech-sdk 的 Microsoft Cognitive Services Speech SDK 的 JavaScript 版本。
关于 SpeechSynthesizer,我将 SpeakerAudioDestination 包含在其中。我想在音频播放完成后做点什么,所以我添加了 onAudioEnd 事件,但它从未被触发。 下面的代码正确吗?
player = new SpeechSDK.SpeakerAudioDestination();
player.onAudioEnd = function (s) {
console.log("onAudioEnd", s);
};
synthesizer = new SpeechSDK.SpeechSynthesizer(speechConfig,
SpeechSDK.AudioConfig.fromSpeakerOutput(player));
感谢任何帮助!
【问题讨论】:
标签: text-to-speech microsoft-cognitive