Open Simbaclaws opened 3 years ago
Just as a workaround to this, I've been using...
TTS.speak({text: "", cancel: true }).then(
function() { alert("success"); },
function(msg) { alert("error: " + JSON.stringify(msg)); }
);
Great plugin, works very nicely on Android.
However, I'm also seeing a similar cancel issue as the first user on iOS. When i run the following, the speaking stops. Which is great. However, it does not actually show the "successful cancel" in the log / output the console.log value until i try to perform the next TTS.speak action. At which point it executes the earlier cancel and shows 'successful cancel' in the console.log area (but: it's after the user has asked for the next piece of speech -- which leads to its cancellation). The user must press "play" twice to get it to play again after a stop/cancel.
TTS.speak({text: "", cancel: true }).then(
function() { console.log('successful cancel'); },
function(msg) { console.log('failure to cancel'); }
);
Any suggestions are welcome.
Seems apple may be at fault here per: https://stackoverflow.com/questions/19672814/an-issue-with-avspeechsynthesizer-any-workarounds
Hey,
apparently when I do:
The then and catch are not being called... The stop is being called though, so I think I'lll just remove the .then and set it to false after calling stop.
It is nice to have a callback to know whether it stopped or errored out for some reason though.