Skip to content

0.2.0

Compare
Choose a tag to compare
@janantala janantala released this 21 Feb 22:09
· 29 commits to master since this release

Features

  • Rename speechSynthesis into speechSynthesisPolyfill and and SpeechSynthesisUtterance into SpeechSynthesisUtterancePolyfill

Now you can use speech-synthesis polyfill this way:

// Initialize polyfill
var fallbackSpeechSynthesis = window.speechSynthesis || window.speechSynthesisPolyfill;
var fallbackSpeechSynthesisUtterance = window.SpeechSynthesisUtterance || window.SpeechSynthesisUtterancePolyfill;

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);