Is the Speech Synthesis API supported by Chromium?
Yes, the Web Speech API has basic support in the Chromium browser, although there are several problems with the implementation of the Chromium and Firefox specifications, see Blink> Speech , Internal> SpeechSynthesis , Web Speech .
Do I need to install voices? If so, how can I do this? I am using Fedora. Is the voice similar to the video, do I need to install an additional package for this to work?
Yes, you need to install the voices. Chromium does not come with voices to set the SpeechSynthesisUtterance voice attribute by default, see How to use the Web Speech API on chrome? ; How to capture the generated sound from a window.speechSynthesis.speak () call? .
You can set the speech-dispatcher as the server for the system speech synthesis server and espeak as the speech synthesizer.
$ yum install speech-dispatcher espeak
You can also install the configuration file for speech-dispatcher in the user's home folder to set certain parameters for both speech-dispatcher and the output module that you use, for example espeak
$ spd-conf -u
Running Chromium with the --enable-speech-dispatcher flag automatically creates a connection to the speech-dispatcher , where you can set LogLevel between 0 and 5 to view the SSIP connection between the Chromium code and speech-dispatcher .
.getVoices() returns results asynchronously and requires a double call
see this electron problem on GitHub Speech Synthesis: No Voices # 586 .
window.speechSynthesis.onvoiceschanged = e => { const voices = window.speechSynthesis.getVoices();
or consists of an asynchronous function that returns a Promise with a value that is an array of votes
(async() => { const getVoices = (voiceName = "") => { return new Promise(resolve => { window.speechSynthesis.onvoiceschanged = e => { // optionally filter returned voice by `voiceName` // resolve( // window.speechSynthesis.getVoices() // .filter(({name}) => /^en.+whisper/.test(name)) // ); resolve(window.speechSynthesis.getVoices()); } window.speechSynthesis.getVoices(); }) } const voices = await getVoices(); console.log(voices); })();