Ad
How To Detect End Of Speech In ResponsiveVoice JS
I'm working with the ResponsiveVoice text to speech library.
Everything is working perfectly fine except there seems to be no way of detecting the end of speech in the API.
On the responsiveVoice
object I'm able to see the OnFinishedPlaying
callback but it doesn't work. Neither does the onend
callback mentioned here.
Right now I'm using the setInterval
to poll on isPlaying
method to detect the end of speech. However it would be great if there was a method to do so properly.
Here's the code on Github that I'm working with.
And here's a minimal JSFiddle test code.
Ad
Answer
The mentioned onend
callback is working if you put the options object as the 3rd parameter:
responsiveVoice.speak('Responsive Voice is ready', 'UK English Male', {onend: yourCallbackGoesHere});
See JSFiddle
Ad
source: stackoverflow.com
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad