javascript speechSynthesis no sound

1.9k views Asked by At

I working with the speech to text service of speechSynthesis in chrome. It worked like charm until 2minutes ago, everything works but no sound!

this is my code:

var msg = new SpeechSynthesisUtterance();
msg.volume = options.volume;
msg.rate = options.rate;
msg.pitch = options.Pitch;
msg.lang = options.lang;
msg.text = options.text;
window.speechSynthesis.speak(msg);

is there a call limit or something?

1

There are 1 answers

0
Frazer On

In my experience the Chrome queue sometimes gets 'stuck' and it's useful to have a cancel command handy. Next time this happens try running this in the console:

window.speechSynthesis.cancel();

Alternatively attach the command to a Cancel button. NB it can be on any page, not necessarily the same page as your utterance.