Voice Recognition stops listening after a few seconds

前端 未结 5 1288
执笔经年
执笔经年 2020-11-29 01:20

I tried a lot but can´t find it out, so I hope you can help me.

I am trying to build my own voice recognition app, which doesn´t show up the dialog.

I alread

5条回答
  •  鱼传尺愫
    2020-11-29 02:00

    You could try to supply the following RecognizerIntent extras:

    • EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS
    • EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS
    • EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS

    although none of them really fits in this case. Android simply doesn't offer a "WAIT_UNTIL_I_START_SPEAKING" extra. It's not a bug (in Jelly Bean or where ever), it's simply a lack of a feature. And even if such an extra is added in a future version of Android there might not be a guarantee that the speech recognition app (such as Google Voice Search) actually implements this. The RecognizerIntent documentation contains plenty of extras with unspecified behavior.

    Your best option might be to relaunch the recognizer as soon as you get onEndOfSpeech or onError.

提交回复
热议问题