Closed peterbe closed 10 years ago
Ah! I see why, the demo doesn't attempt to use window.speechSynthesis
or window.SpeechSynthesisUtterance
If I change my app to only use the polyfill it works for me too. Not ideal though.
It looks like there is already a SpeechSynthesis object in Firefox (v28, in v26 it is ok) but no SpeechSynthesisUtterance.
SpeechSynthesis {pending: false, speaking: false, paused: false}
So we still can't use native speech synthesis and we will need a better detection. I will update docs.
Check out v0.4.0
var fallbackSpeechSynthesis = window.getSpeechSynthesis();
var fallbackSpeechSynthesisUtterance = window.getSpeechSynthesisUtterance();
var u = new fallbackSpeechSynthesisUtterance('Hello World');
u.lang = 'en-US';
u.volume = 1.0;
u.rate = 1.0;
u.onend = function(event) { console.log('Finished in ' + event.elapsedTime + ' seconds.'); };
fallbackSpeechSynthesis.speak(u);
Works like a charm! Thank you!
Using
I get:
Strangely the example on http://janantala.github.io/speech-synthesis/ works in this browser.