我想了解RecognitionService和RecognitionService.Callback的功能。我对这个框架相当陌生,并且想知道如何在RecognitionService中调用onStartListening()函数。我看到帖子How to register a custom speech recognition service?,但是我已经在所有主要函数中插入了日志消息,以查看哪个函数在什么时候被调用。了解语音识别服务
我也看了一下sdk中的示例应用程序,但它解释了事情发生的过程中做得很糟糕。我想从一个活动中调用startService。
我用下面的意图
Intent startServiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
startServiceIntent.setClass(this, SimpleVoiceService.class);
startService(startServiceIntent);
可能有人请帮助我得到这个工作。如果有人能指点我一个关于这个的教程,或者描述如何做到这一点的一般流程,那将是非常棒的。
非常感谢。