无法找到如何从StartContinuousRecognitionAsync((获取数据,因为我想接收数据,这样我只能在关键字之后处理数据。
试试这个:
...
recognizer = new SpeechSDK.SpeechRecognizer(speechConfig, audioConfig);
recognizer.startContinuousRecognitionAsync(cb?: () => void, err?: (e: string) => void);
// The event recognizing signals that an intermediate recognition result is received.
recognizer.recognizing = function(s, e){
console.log('recognizing text', e.result.text);
};
// The event recognized signals that a final recognition result is received.
recognizer.recognized = function(s, e){
console.log('recognized text', e.result.text);
script += e.result.text;
};
您必须"监听"语音事件才能从语音端点接收语音识别结果。这在文档中进行了解释,并在示例中进行了演示。
以下是C#示例:https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-recognize-speech-csharp#continuous-演讲-从文件
有关最新的样品集,请查看我们的https://aka.ms/csspeech/samplesGitHub存储库。
关于这一声明的另一条评论:
希望这能有所帮助Wolfgang