如何在speechRecognizer ContinuousRecognitionSession中更改超时

时间:2016-08-15 01:56:44

标签: c#

我正在尝试使用SpeechRecognizer ContinuousRecognitionSession。如果我的谈话时间超过20秒,则表示SpeechRecognizer ContinuousRecognitionSession超时。

我一直在SpeechRecognizer.ContinuousRecognitionSession.Completed事件中获得SpeechRecognitionResultStatus.TimeoutExceeded状态。

我想更改默认超时。我不知道我会在哪里做。我尝试了以下代码

speechRecognizer.Timeouts.EndSilenceTimeout = new TimeSpan(1, 0, 0);
speechRecognizer.Timeouts.InitialSilenceTimeout = new TimeSpan(1, 0, 0);
speechRecognizer.Timeouts.BabbleTimeout = new TimeSpan(1, 0, 0);
speechRecognizer.ContinuousRecognitionSession.AutoStopSilenceTimeout = new TimeSpan(1, 0, 0);

感谢您的回复。

1 个答案:

答案 0 :(得分:0)

Maybe you can try this :recognizer.Timeouts.InitialSilenceTimeout = TimeSpan.FromDays(1)