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

Better recognition control #2

Merged
merged 14 commits into from
Jul 22, 2017
Merged

Better recognition control #2

merged 14 commits into from
Jul 22, 2017

Conversation

JamesBrill
Copy link
Owner

The goal of this PR is to give the user more control over the Web Speech API. Previously, the recognition object was not aborting speech recognition detection correctly, and was failing on re-renders. The use of a singleton recognition object and improved controls should alleviate this issue.

  • listening bool prop: if true, the Web Speech API is listening to speech from the microphone.
  • startListening func prop: causes the Web Speech API to start listening to speech from the microphone.
  • stopListening func prop: causes the Web Speech API to stop listening to speech from the microphone, but will finish processing any remaining speech.
  • abortListening func prop: causes the Web Speech API to stop listening to speech from the microphone, and also stop processing the current speech. Initially, the Web Speech API is turned on, so you may want to call this in componentWillMount if you don't want speech to be collected when your component is first mounted.

@JamesBrill JamesBrill merged commit e3084ae into master Jul 22, 2017
@JamesBrill JamesBrill deleted the better-recognition-control branch July 22, 2017 22:01
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.

1 participant