You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the built-in event handlers in the Speech Recognition object, which is given to you as a property called recognition. You can set these to your callback function when constructing or mounting your component:
const { recognition } = this.props
recognition.onend = () => console.log("Listening has stopped");
recognition.onstart = () => console.log("Listening has started");
Detect changes to the listening property, which is another property injected by react-speech-recognition. If you're using a class-based React component, you can pick up these changes in the componentWillReceiveProps lifecycle hook. For example:
componentWillReceiveProps(nextProps) {
if (this.props.listening !== nextProps.listening) {
console.log(nextProps.listening);
}
}
Will we get any callbacks while invoking async functions such as startListening,stopListening,abortListening ?
If so, how can we handle the callbacks?
The text was updated successfully, but these errors were encountered: