-
-
Notifications
You must be signed in to change notification settings - Fork 39
Description
It took me about an hour to figure out why my speech wasn't being generated, I assumed I had the plugin setup wrong or something. If you look at the web speech API (https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section), the SpeechSynthesisUtterance constructor takes an optional argument, "DOMString text". Your plugin instead requires text to be set after the object is created.
In essence, this should be valid but it instead triggers an error event:
var u = new SpeechSynthesisUtterance("I have something to say");
speechSynthesis.speak(u);
I've fixed my code, but I'm sure it will surprise someone else and it would be great if you could update the code to match the spec. I'll try to find time to issue a pull request with the change, but this would be my first android code so it might take me a little bit to work up the courage :-).