Open jlchereau opened 6 years ago
@jlchereau it is published on npm at https://www.npmjs.com/package/phonegap-plugin-speech-synthesis
So thanks for the heads up. I can make some changes to the JS to better align with the spec and publish to NPM.
Fixed #6
Thx @macdonst for your very neat plugin. You might also want to check SpeechSynthesisVoice.default as it is always false both on Nexus 2012 with Android 5 and Amazon Tablet with FireOS 5.6, whereas there should be a default voice for each language. See #20.
1) SpeechSynthesisVoiceList is not part of the Web Speech API: getVoices should return an array of voices:
2) getVoices are loaded asynchronously
The first time it is called, window.speechSynthesis.getVoices() returns a
number
and voices_list is undefined; The second time it is called window.speechSynthesis.getVoices() returns aSpeechSynthesisVoiceList
. Tested on Andorid Nexus 2012 tablet with Android 5 and Amazon Tablet with FireOS 5.6 I think this is because Phonegap now uses Chrome Web View and Chrome loads voices asynchronously.Therefore you need:
3) SpeechSynthesisUtterance should be updated to take voice and not voiceURI and lang
4) See https://github.com/macdonst/SpeechSynthesisPlugin/issues/6
It would also be nice to publish this plugin on npm especially to avoid it being listed each time you check
npm outdated
.