Ask HN: Are there any good open source text-to-speech tools?
There are paid services that offer this (e.g. resemble.ai), and a few colab notebooks that I haven't found very helpful, but I wanted to know whether anyone here has had any luck with free text to speech (tts, t2s) tools. Thank you!
126 comments
[ 3.0 ms ] story [ 116 ms ] threadhere are some demos https://nonint.com/static/tortoise_v2_examples.html
Also I am a native Swiss German speaker. For those who don't know: Swiss German is a dialect continuum, very very different from standard German to an extend, that most untrained German speakers don't understand us. There is no orthography (writing rules), no grammar rules etc. It's a mostly undocumented/unofficial writing system. Only spoken, and the varieties are vast. And guess what, I can write in completely random, informal Swiss German dialect and ChatGPT understands everything, but answers in standard German.
But as always only successful prompts are shared so I don't know how hit or miss it is
> Tortoise is a bit tongue in cheek: this model is insanely slow. It leverages both an autoregressive decoder and a diffusion decoder; both known for their low sampling rates. On a NVidia Tesla K80, expect to generate a medium sized sentence every 2 minutes.
I suspect that for a real(-ish) time TTS system, something else is needed. OTOH if you want to record some voice acting for a game or other multimedia product, it still may be more cost-effective than recording a bunch of live humans.
(K8 = NVidia Tesla K80, GPU, $800-900 for a 24GB version right now.)
Tortoise produces quality results with limited training data, but is an extremely slow model that is not suitable for real time use cases. You can't build an app with it. It's good for creatives making one-off deepfake YouTube videos, and that's about it.
You're looking for Tacotron 2 or one of its offshoots that add multi-speaker, TorchMoji, etc. You'll want to pair it with the Hifi-Gan vocoder to get end-to-end text to speech. (Avoid Griffin-Lim and WaveGlow.)
Your pipeline looks like this at a high level:
TalkNet is also popular when a secondary reference pitch signal is supplied. You can mimic singing and emotion pretty easily.These three models are faster than real time, and there's a lot of information available and a big community built up around them. FakeYou's Discord has a bunch of people that can show you how to train these models, and there are other Discord communities that offer the same assistance.
If you want to train your own voice using your own collected sample data, you can experiment with it on Google Colab and on FakeYou, then reuse the same model file by hosting it in a cloud GPU instance. We can also do the hosting for you if that's not your desire or forte.
In any case, these models are solid choices for building consumer apps. As long as you have a GPU, you're good to go. If you're not interested in building or maintaining your own, you can use our API! I'd be happy to help.
Can I ask another question? If I wanted to hack around with STT and TTS (inference only) on a pi (4B+) is there anything that is approximately appropriate and can be done on device? (I could process on my main machine but I'd love to do it on the pi even with a decent delay)
There are other ML TTS models that are both lightweight and can run on a CPU. Check out Glow-TTS for something that will probably work.
Also swap out the HifiGan vocoder for Melgan or MB-Melgan as these will also better support your use case.
I ran this exact setup on cheap Digital Ocean droplets (without GPUs) and it ran faster than real time. It should work on a Pi.
Unfortunately I'm not aware of STT models that operate under these same hardware constraints, but you should be good to go for TTS. With a little bit of poking around, I'm sure you can find a solution for STT too.
They provide support for running in a Raspberry Pi and it runs in real-time. I have tried the desktop version and the quality is good enough when the audio is clean.
What would run if you had large set of training data (and time and money) but your focus is on quality? Still Tortoise?
https://news.ycombinator.com/item?id=33438487
But:
https://news.ycombinator.com/item?id=34188255
I wrote a blog post recently which talks a little about the origin of my voice in Mycroft, in case anyone is interested. https://popey.com/blog/2022/10/blog-to-speech-in-my-voice/
https://github.com/coqui-ai/TTS
Other than that, I've never used the product, but I've seen Youtube ads for Speechelo, which seems to be quite decent (and a bunch of Youtube ads for other things that quite obviously were using Speechelo (same voice))
I ended up going with pico-tts[0]. I remember looking at a few other things and left myself the following comment:
[0] https://github.com/Iiridayn/pico-ttsHere's how it works:
- Kid requests a story about a, b, c on www.makedupstories.com
- chatGPT generates the text for a story, summary, and title
- we send this to resemble.ai (sounds like Tortoise TTS would work just as well), which has a clone of my voice
- the audio file then gets sent to anchor.fm
you can listen to example episodes here on Spotify: https://open.spotify.com/show/6liL4T3kJf1scHq134s0mJ
And here on Apple podcasts: https://podcasts.apple.com/us/podcast/kidscast-kids-stories-...
> She couldn’t tell a difference. My husband and I could tell it was different [...]
I wonder if the child will eventually be able to tell the difference, when the machine-generated audio is a large fraction of what they hear in their early years. Or if they just learn to consider that 'normal', and maybe model their own speech patterns after it.
Also, anecdotes from parents (is that what you're referring to by "clear empirical evidence"?) are not evidence.
https://www.greatschools.org/gk/articles/word-gap-speak-more...
There's a saying that the best jokes are somewhat offensive if not very witty, and ChatGPT might be playing safe lol.
There exists an interpretation of that statement that makes it a tautology.
Edit: and/or makes it circular/symmetrical - "What is a "kid"" (a Turing test mis-labeller). A good AGI was required to be able to convince a panel - assuming an ideal panel, the usual simplification "employing" perfect agents in economic modelling -, and there now exist new means to conversely assess the panel.
"Hi richardfeynman and Merry Christmas! Carissa enjoyed her story and decided after that she needs to submit another one She couldn’t tell a difference. My husband and I could tell it was different, but still pretty impressive how the AI works! We will share with friends this week!" "Thank you so much for the story of Anders and his goat Gizmo. We love Maked up Stories and listen to one every evening, so it really made Anders’s day to have his own story. We have shared it with family and friends."
I'm not a kid and have no kids so it's hard for me to appreciate this type of storytelling. Have you been able to gather an audience that regularly tunes in?
Personally - despite being neither the target market or that interested in an answer to the original question, I found the reply you are objecting to interesting and useful, and not at all the crass promo you are claiming.
OP's project is really cool and would make for a great Show HN. This thread is just the wrong place for it.
Please abide to HN Rules and Guidelines next time.
I would have been warier of exposing them to products of unintelligence.
Have Tony the Tiger explaining the food pyramid or something.
First, though, read "I Always Do what Teddy Says", by Harry Harrison.
it's the only one I have any experience with
https://paperswithcode.com/task/text-to-speech-synthesis
https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynth...
Demo Here: https://mdn.github.io/dom-examples/web-speech-api/speak-easy...
Read more here https://github.com/mdn/dom-examples/tree/main/web-speech-api