8

仅从名称中,我可以得出stopListening()与startListening()相反。

我也可以理解destroy()与createSpeechRecognizer()相反。

但是cancel() ... 与什么相反?

我在文档中能找到的只是:

取消语音识别。

cancel() 与 stopListening() 有何不同?

4

1 回答 1

5

好吧,您取消 SpeechRecognition,即我假设没有返回给您的结果,而在 stopListening() 上您只需告诉识别器您已完成讲话,它现在应该进行实际识别(并且可以关闭麦克风)。通常,您不需要自己调用 stopListening(),因为语音结束是自动确定的(自动终结)。

于 2011-04-21T13:26:52.330 回答