speech-synthesis

Speech Synthesis polyfill

Fork me on GitHub

bower install speech-synthesis

Load dependecies:

<script src="bower_components/speech-synthesis/polyfill.min.js"></script>

Usage:

// Initialize polyfill
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);

`