How to stop reading SpeechSynthesisUtterance text when switching to another page?

  • 0
    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

  • 1 Answers
  • 0

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!