jamsch / expo-speech-recognition

Speech Recognition for React Native Expo projects
MIT License
128 stars 11 forks source link

`end` event fires if no speech detected for 10 seconds even in continuous mode? #32

Closed danny188 closed 1 month ago

danny188 commented 1 month ago

Hi,

Is there a way to keep the recording going even if no speech is detected for a few seconds?

I find that the end event fires even in continuous mode after not speaking for about 10 seconds.

danny188 commented 1 month ago

My current workaround is to create another state variable to check if user actually pressed "stop recording". If the the recording was stopped by lack of speech instead of by the user, re-start speech recognition inside the end event.

jamsch commented 1 month ago

Hey @danny188, the continuous mode is only currently supported for Android 13+ and iOS. It's not possible to do continuous recognition on older Android versions unfortunately due to an API limitation in the Android speech recognizer. You'll have to essentially do what you're doing which is to start the recognizer when it stops