[Vuejs]-Error on text-to-speech api : ReferenceError: speechSynthesis is not defined

0👍

It looks like you’re attempting to use the Web Speech API in a non-browser JS environment. Unless your JS environment implements the Web Speech API, you need to find some alternative API that is supported by your JS environment.

Given that you’re using Cordova, you should probably try using something like this: cordova-plugin-tts

0👍

Try this I hope it will fix…

 let utterance = new SpeechSynthesisUtterance(`Hey`);

 SpeechSynthesis.speak(utterance);

-1👍

replace this SpeechSynthesis.speak(utterance) with speechSynthesis.speak(utterance) then it work

Leave a comment