45 points · by rafael1mc · 1y ago · 9 comments
I wanted to continue "reading" even after my eyes got tired or if I went away from the screen. For these cases, what I did was select a given text, and select "Speech". If you've used this before, you know it's fine for small sections, but not for big chunks of text.
So, I challenged myself to create a project that would "text-to-speech" a given book. After some attempts, I came up with a good-enough initial version using Golang. It will parse an ePUB into sections and run MacOS's `say` command to generate audio files.
For now it's quite basic, but worked fine for the few files I tested.
https://github.com/JarodMica/audiobook_maker
Here is a video about it:
https://www.youtube.com/watch?v=HbUnb5znNwM
With gradio and F5-TTS it is also possible to train your own voice by Speech-To-Text via Whisper and after this train your model to use the generated LJSpeech dataset to train your own voice model for F5-TTS. Video:
https://www.youtube.com/watch?v=GmketyZW2c4
This way you basically can take any audio book with your favourite narrator, clone his voice and let him read ANY of your epubs. Even more, you could use F5-TTS extensions to use different voices e.g. for female and male characters:
{male} What's up?
{female} Nothing.
{male} Ok
{narrator} After this they both hung up the phone.
But you'd probably need a pretty decent GPU to get this going :-)Because I did. For the kids. Not exactly the same:
1. Put in any ebook, in any language. 2. LLM translates it into German. 3. XTTS turns it into audio.
Devil’s in the details, of course.
I’m usually very picky about translations. Many books that I’ve read in English and wanted to gift to someone in my family have turned out so rotten in their translation that their “soul” was lost. Against that background, I am very pleased with the results.
Cost: About $0.20 per book. A bit more if it’s Asimov’s New Guide to Science.
I think if the ePUB and the OS are in the same language, it should (?) work, although I haven't tested it.
Sometimes it gets a bit messy around punctuation, but I've never had to go back and listen again.
If I interpreted the "prosody" part correctly, then there is some intonation, but it doesn't mimic emotions, so it's very basic. For example, it will slightly differentiate "Shut up" from "Shut up!" (with exclamation mark).