9

Chromium is not producing voice when I am running my code, while this is working in chrome.

var msg = new SpeechSynthesisUtterance('Hello World');

window.speechSynthesis.speak(msg);
Shubham Tiwari
  • 231
  • 3
  • 8
  • Five years later - it's still not working (Chromium 86.0.4240.75, Ubuntu 20.04), but DOES work in Firefox. What's up with that, Google? – obe Apr 18 '21 at 19:30

3 Answers3

3

I couldn't get it to work myself. From the article: https://bugs.chromium.org/p/chromium/issues/detail?id=251288

we need to use --enable-speech-synthesis and the speech dispatcher apt-get install speech-dispatcher

Since that did not work I tried also installing libspeechd & espeak but still chromium(58.0.3029.110) seemed unable to pickup any speech engine.

Also just to cover my basis I have tried all of this with the flag mentioned above --enable-speech-dispatcher which gave me a "you are using an unsupported command-line flag" warning.

All of this on x64 and arm64 ubuntu 16.04.2.

1

Install espeak with a package manager, to populate SpeechSynthesis.getVoices() array with voices from espeak for chromium browser speech dispatcher to utilize

$ sudo apt-get install espeak

Then launch chromium with --enable-speech-dispatcher flag set.

guest271314
  • 1
  • 4
  • 18
0

Speech synthesis is disabled by default in chromium builds on debian/ubuntu. Enable it with the --enable-speech-dispatcher command line flag.

Note however that voices are not supported without installing Google API keys.

kynan
  • 2,207
  • 1
  • 22
  • 24
  • 2
    No, it looks like speech synthesis was removed from the runtime feature list two years ago and is enabled by default in Chromium. I'm not sure why it can't use the system TTS, which is what Firefox seems to do with no problem. – Desty Nov 26 '16 at 22:58