Created
January 20, 2020 13:41
-
-
Save ignitz/23a15ac06dc80838d70a0dcb5b4548cb to your computer and use it in GitHub Desktop.
Browser voice engine 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=100%, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<script> | |
function playAudio() { | |
var msg = new SpeechSynthesisUtterance("Marcola!"); | |
msg.lang = "pt-BR"; | |
window.speechSynthesis.speak(msg); | |
} | |
</script> | |
<button id="runProgram" onclick="playAudio();" class="runProgram-button"> | |
Clica aqui! | |
</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment