Created
February 27, 2018 10:15
-
-
Save greengiraffe/0cef51852a0417b047e027c7274ca6ae to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/natayar
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| speechSynthesis.cancel(); | |
| const utterance = new SpeechSynthesisUtterance(); | |
| const testString = "Sobald das Wort E-Mail auftaucht, liefert das onboundary-Event falsche Werte." | |
| utterance.text = testString; | |
| utterance.pitch = 1; | |
| utterance.rate = 0.5; | |
| utterance.volume = 1; | |
| utterance.voice = speechSynthesis.getVoices().find(v => v.lang === 'de-DE'); | |
| utterance.onboundary = event => { | |
| console.log("charIndex: " + event.charIndex); | |
| console.log("char: " + testString.slice(event.charIndex, event.charIndex + 1)) | |
| } | |
| speechSynthesis.speak(utterance) | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">speechSynthesis.cancel(); | |
| const utterance = new SpeechSynthesisUtterance(); | |
| const testString = "Sobald das Wort E-Mail auftaucht, liefert das onboundary-Event falsche Werte." | |
| utterance.text = testString; | |
| utterance.pitch = 1; | |
| utterance.rate = 0.5; | |
| utterance.volume = 1; | |
| utterance.voice = speechSynthesis.getVoices().find(v => v.lang === 'de-DE'); | |
| utterance.onboundary = event => { | |
| console.log("charIndex: " + event.charIndex); | |
| console.log("char: " + testString.slice(event.charIndex, event.charIndex + 1)) | |
| } | |
| speechSynthesis.speak(utterance) | |
| </script></body> | |
| </html> |
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
| speechSynthesis.cancel(); | |
| const utterance = new SpeechSynthesisUtterance(); | |
| const testString = "Sobald das Wort E-Mail auftaucht, liefert das onboundary-Event falsche Werte." | |
| utterance.text = testString; | |
| utterance.pitch = 1; | |
| utterance.rate = 0.5; | |
| utterance.volume = 1; | |
| utterance.voice = speechSynthesis.getVoices().find(v => v.lang === 'de-DE'); | |
| utterance.onboundary = event => { | |
| console.log("charIndex: " + event.charIndex); | |
| console.log("char: " + testString.slice(event.charIndex, event.charIndex + 1)) | |
| } | |
| speechSynthesis.speak(utterance) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment