Created
April 17, 2017 00:24
-
-
Save blacktaxi/7d798b6b0f2674cd86d0bb6ee3496fd4 to your computer and use it in GitHub Desktop.
webkitSpeechRecognition API usage example
This file contains 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
// copy-paste this into a Chrome new tab console and allow mirophone input | |
// when prompted | |
var r = new webkitSpeechRecognition() | |
r.continuous = true | |
r.interimResults = true | |
r.onresult = e => | |
console.log( | |
[...e.results].map( | |
r => r.length > 1 | |
? '[' + [...r].map(a => a.transcript).join('|') + ']' | |
: r[0].transcript).join(' ')) | |
r.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment