How to stop reading SpeechSynthesisUtterance text when switching to another page?
-
How can I make the speech stop sounding the text after dubbing using the
SpeechSynthesisUtterance
method, when switching to another page in the same window?
<button class="let-speak" onclick="speek();">Произнести вслух</button> <input id="text" value=""> <script> function speek() { window.speechSynthesis.speak(new SpeechSynthesisUtterance(document.getElementById("text").value)) } </script>
JavaScript Ethan Tucker, Aug 6, 2019 -
window.speechSynthesis.cancel () ?Aubrey Preston
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!