Created
August 20, 2016 06:27
-
-
Save josher19/7782be6407f3223be7dc52c98f0b2e1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var voices = speechSynthesis.getVoices(); | |
var ops = { | |
once: true, | |
voice: voices && voices.filter(function(v) { return v.localService })[0] | |
}; | |
for(var i=0; i< document.links.length; ++i) { | |
document.links[i].onmouseover = function() { | |
var utter = new SpeechSynthesisUtterance(this.text); | |
if (ops.voice) utter.voice = ops.voice; | |
speechSynthesis.speak(utter); | |
if (ops.once) this.onmouseover = null; | |
} | |
} |
Author
josher19
commented
Aug 20, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment