Created
October 6, 2018 02:56
-
-
Save sunb0002/21e568ec9a98634c1c18ae2ad540b3cb to your computer and use it in GitHub Desktop.
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
// Code detail -- https://blog.teamtreehouse.com/getting-started-speech-synthesis-api | |
// Demo -- https://codepen.io/matt-west/pen/wGzuJ | |
function sayit(text, voice) { | |
var msg = new SpeechSynthesisUtterance(); | |
msg.text = text; | |
msg.voice = voice | |
speechSynthesis.speak(msg); | |
}; | |
sayit ('Hello ! This is Alex','en-US'); | |
sayit ('こんにちは ! kyokoです','ja-JP'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment