Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix iOS 18 bug where onSpeechEnd is never called #521

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndersonVanzo
Copy link

Refers to #517

@jamsch
Copy link
Contributor

jamsch commented Oct 17, 2024

Just a few notes on this PR (as I work on a similar library):

  • There's a bit of functionality change here to how would previously have worked on iOS. I'm pretty sure on the current version of react-native-voice for iOS, speech recognition runs continuously. On Android it stops once you've paused for a second or two and processes a final result. This PR brings the functionality similar to Android.
  • So the part where you have transcript = [@" " stringByAppendingString:transcription.formattedString]; is unnecessary as this is actually meant for continuous speech transcription where multiple final segments occur in a speech recognition task.
  • If this library does implement continous recognition, you'll also need to reset the _hasSeenFinalResult variable back to it's initial state once starting speech recognition, otherwise you'll see an extra prepended space on your second and subsequent speech recognition attempts, such as the following:
onSpeechPartialResults "this"
onSpeechPartialResults "this is"
onSpeechPartialResults "this is a"
onSpeechPartialResults "this is a demo"
onSpeechPartialResults "this is a demo"
onSpeechResults        " this is a demo"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants