FF's TTS is an important project for anyone who wants a trivial to use text-to-speech system. It's built into the browser so you can just run
wss = window.speechSynthesis;
for (let i = 0; i < wss.getVoices().length; ++i){
str = `Voice ${i} is ${wss.getVoices()[i].name}`;
s = new SpeechSynthesisUtterance(str);
s.voice = wss.getVoices()[i];
wss.speak(s);
console.log(str);
}
in the console to get various TTS examples. For some browsers, this can be done offline while others use a cloud based TTS system.
Is there a handy demo website somewhere to access that?
I extracted Narrator module from Firefox'es reader mode. It's not so good in other browsers though. On macOS, I'm using Alex voice.
https://tts.cns.wtf/
https://github.com/python273/tts-app
I've tried this on Linux+Firefox, but it doesn't sound very good yet, I'm afraid.
Yeah, it's using OS's voices and usually they are quite robotic. But it's still quite useful if you want to upload a long text into your brain.
I'm also using Narrator in my HN reader (no settings for voice right now though, except localStorage['cfg-narrator-rate'] via devtools):
https://hn.cns.wtf/#38532761
This also works in Chrome (My version is: 119.0.6045.199)
FF has 8611 voices, chrome has 19.
That's odd, my Chrome (119.0.6045.199) has 176 voices. Not all are English though.
Maybe it's because I'm linux? (Pop!_OS 22.04 LTS)
Also I have 3 English only.
Do you know if it’s been extracted into a standalone library? The state of the open source TTS seems to not be great. Presumably the data for a voice is harder to put together than training a speech to text system like whisper.
The voices don't come from the browsers themselves, but from operating systems and their underlying TTS APIs, SAPI on Windows, Speech Dispatcher on Linux and AVSpeechSynthesizer on Apple Devices. If you install a third-party voice compatible with one of these, the browsers will pick that up.
This is a reasonably good open source local TTS that's fast enough to use in home automation: https://github.com/rhasspy/piper
On macOS, it's
To pick a different voice: To list voices: (The quoting is necessary to prevent ZSH from interpreting the question mark as a glob.)I hear Firefox's TTL is important, yet prior to your comment I didn't even know it existed. This sort of stuff should be more discoverable, and have a more accessible (ahem) API.
It's part of the web apis, it's not just firefox. Chrome and Safari have supported it since 2013/2014.
It looks like speechSynthesis is supported in all the major browsers, not just FF. https://developer.mozilla.org/en-US/docs/Web/API/Window/spee...
This is handy to know, thanks. I was just trying out Common Voice a few days ago.
They have a good example of a community page for folks wanting to help with a particular language.
I was just thinking today that Firefox is worthy of switching back to because it was so fast,except I hadn't had a chance to do it.
If anyone else thinks it's important for there to be an independent browser dedicated to privacy and security (and independence), they could as many casual browser switchers. I'm happy to be back on a few FF extension that didn't work quite the same on any chrome based browser.
Nice! For debugging I've been having a lot of fun supplementing stderr (for especially important messages that I don't want to miss) with the free TTS voices available on Windows (by running a Powershell command) and from Chrome (via WebSocket). It's nice to have even more voices to choose from.
Pretty cool, it printed a list of over 8000 on my machine (Ubuntu, well Kubuntu now) and then proceeded to speak the voices after printing them all.