I modified a github code so it creates audiobooks from txt files in many languages, in a friendly way

Hi there, I wanted to create an audiobook from a book written in mandarin chinese. I struggled to find a way to do this so I had to edit a code I found on github with the help of chatgpt.

Here's the code: https://github.com/languagemaniac/Google-Translate-TTS-2.0

Instructions:

Download and execute "python GoogleTTS.py"

It will open the Welcome screen, ask you to choose a language by inputting a number and then it's going to ask you at which speed do you want your document to be read.

Here's what a sentence in English sounds like at a speed value of 0.4

Here's what a sentence in English sounds like at a speed value of 0.5

Useful if you're learning a new language

Then it's going to ask you for the filename of your novel. I have only tried txt files. So just place your novel in the same folder and type its name. eg. mynovel.txt

Now it will display a progress bar, and it will download the audio for your novel and save it with the same file name base, as an mp3. In this case mynovel.mp3

The number of simultaneous downloads can be changed by altering the "max_workers" number in the code. Currently set to 20. So if you have internet issues you might want to lower that number idk.

I hope someone here finds it useful.

Note: If the language you want to select is not on the list, open an issue in github or comment here and I'll add it.

submitted by /u/LanguageManiac
[link] [comments]

from Language Learning https://ift.tt/IveSxXA
via Learn Online English Speaking

Comments