Would it be possible to add this code in speak function in order to better deal with voice errors?
please
utterance.addEventListener('error', function (event) {
console.error("Failed to speak with \"" + voice.name + "\" voice, caused by :", event.error);
cancel()
});
optionally it would be a good idea to add callbacks in the arguments for onend and error listener :
const { onEnd= () => {}, onError= () => {} } = props;
...
utterance.addEventListener('error', function (event) {
console.error("Failed to speak with \"" + voice.name + '" voice, caused by :', event.error);
cancel()
onError(event)
});
Would it be possible to add this code in speak function in order to better deal with voice errors? please
optionally it would be a good idea to add callbacks in the arguments for onend and error listener :