Created
December 15, 2017 10:39
-
-
Save yiyizym/e1531c1d4d51ca25fce1af6a6a1548ab to your computer and use it in GitHub Desktop.
browser_speak
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script> | |
var speechSU = new window.SpeechSynthesisUtterance('我来自中国'); | |
speechSU.lang = 'zh-CN'; | |
// var speechSU = new window.SpeechSynthesisUtterance('私は中国から来た'); | |
// speechSU.lang = 'ja-JP'; | |
window.speechSynthesis.speak(speechSU); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment