capacitor-community / speech-recognition

MIT License
81 stars 43 forks source link

Event Listener for Final Result or Listening Stopped #68

Closed alistairheath closed 1 week ago

alistairheath commented 1 year ago

Is your feature request related to a problem? Please describe. On iOS and Android when implementing this plugin, speech recognitions starts and then stops either when the user finishes talking or after a predetermined a mount of time. Whilst it is possible to capture the partial results as the listener is talking. It doesn't seem possible to either listen indefinitely and the use the .stop() method to manually stop listening and process teh final result, nor is there a listener to return the full result.

Describe the solution you'd like I think the above could be solved with one of two new features:

Describe alternatives you've considered

OnlinePage commented 11 months ago

any update on it ? please!! @jcesarmobile

adamcohenhillel commented 9 months ago

Is there an update on this one?

focafull commented 5 months ago

For me not having this events makes it unusable for now. Maybe an error event would be nice to have.

veneliniliev commented 5 months ago

I need this feature too! pleaseee @jcesarmobile

shaibrown5 commented 2 months ago

for me IOS works fine, records on start and stops recording on stop. however Android does not work. as stated above, the recording finishes when user pauses or after a few seconds.

PR #83 added a useful isListening method that has 2 problems: Ios - isListening returns undefined both when recording and not. Android - isListening works fine, but can not be used to override the automatic stopping of the recording.

jcesarmobile commented 1 week ago

isListening is working fine for me on iOS, if it doesn't work for you, please, create a new issue and provide a sample app that reproduces the problem

it's not possible to do continuous recognition on any of the platforms, iOS stops after a minute, Android when it detects a silence. You can listen for the listeningState event and when the status is stopped call start again.

iOS was missing some cases where listeningState with stopped value should be fired, fixed on https://github.com/capacitor-community/speech-recognition/pull/95