title: Javascript text-to-speech switch language problem
body: <p>i have an issue changing dynamically the language of the text-to-speech, the first play is correct the second use the previous language. Here the code:</p>
  <pre><code>$('.audio-btn').click(function(){
              let m = $(this).data('content');
              let lang = $(this).data('lang');
              var msg = new SpeechSynthesisUtterance();
              var voices = window.speechSynthesis.getVoices();
              msg.voice = voices[1];
              msg.voiceURI = &quot;native&quot;;
              msg.volume = 1;
              msg.text = m;
              msg.lang = lang;
              speechSynthesis.speak(msg);
            })
  </code></pre>
  <p>and here the button i use:</p>
  <pre><code>&lt;button class=&quot;audio-btn&quot; data-content=&quot;Hola como estas?&quot; data-lang=&quot;es-ES&quot;&gt;&lt;/button&gt;
  &lt;button class=&quot;audio-btn&quot; data-content=&quot;Salut, comment ca va?&quot; data-lang=&quot;fr-FR&quot;&gt;&lt;/button&gt;
  </code></pre>
  <p>thanks</p>