IBM沃森diarization

时间:2017-10-18 18:34:42

标签: c# speech-to-text watson

您好我正在使用c#visual studio 2017开发应用程序,我测试了语音到文本及其工作的代码,但现在我需要做扬声器diarization

我该怎么做?

SpeechToTextService _speechToText = new SpeechToTextService();
_speechToText.SetCredential("", "");
//var results = _speechToText.GetModels();
using (FileStream fs = File.OpenRead("mp3"))
{  
    //  get a transcript of the audio file.
    var results = _speechToText.Recognize("audio/mp3", fs);
}

1 个答案:

答案 0 :(得分:1)

我想出了解决方案

https://www.ibm.com/blogs/bluemix/2017/05/whos-speaking-speaker-diarization-watson-speech-text-api/

代码如下所示:

var results = _speechToText.Recognize("audio/mp3", fs,null, "en-US_BroadbandModel", null, true, null, null, null, null, null, null, null,false, true, **true**); 

最后true标识speaker_label,结果将采用这种方式。

https://console.bluemix.net/docs/services/speech-to-text/output.html#output