pbakondy / cordova-plugin-speechrecognition

:microphone: Cordova Plugin for Speech Recognition
MIT License
197 stars 117 forks source link

completeSilenceLength on Android #113

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi,

This isn't in the documentation, but in the code. I see that you're using a parameter (completeSilenceLength) to set the Android EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS (see: cordova-plugin-speechrecognition/src/android/com/pbakondy/SpeechRecognition.java line 180)

My use case includes speech with several seconds of silence (8-10s), so I've added completeSilenceLength as a parameter in my javascript call (completeSilenceLength: 10000).

speechRecognition.startListening(successCallback, errorCallback, {
    language: language, matches: matches, 
    prompt: prompt, showPopup: showPopup,
    showPartial: showPartial, completeSilenceLength: 10000
});

Unfortunately, the app just ignores the value and stops recording after 2-3s of silence.

Am I doing something wrong or does completeSilenceLength just not work/is not implemented?

Any help in getting me to record speech with 8-10s of silence would be appreciated.

dmuinc commented 3 years ago

Hello,

Unfortunatelly I don't have the solution but do you have find the issue ? I'm interesseting to do the same and I don't find any solution on Internet.

Thanks for your help

reyco1 commented 3 years ago

intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 1000); intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS, 1000);