You can create mp3 file with text and gTTS library (Google Translate's text-to-speech API)
What the program does?
- Generate mp3 file with text
- Generate multiple mp3 files through .txt file
- Multilingual
- A terminal windows program
The simplest method is to install the portable version using the .exe file, available at this link.
Or install with python:
- Python (pip v25 or newer, python v3.10 or newer)
- Python Libraries:
gTTS pygame pyinstaller
-
Install the dependencies following these steps :
- Star this repository
- <>Code > Download ZIP > Open cmd/terminal in that location
- Run this command :
pip install -r requirements.txt
- Run
tts-audio.py
or opentts-audio.bat
after installation
-
If you want to build and creat a .exe program:
- Run this command :
pyinstaller --onefile --icon=icon.ico tts-audio.py
- Your .exe file in your generated dist folder
- Run this command :
-
Pull and run:
- Run this command :
docker pull duc11021102/text-to-speech-audio
- Run this command :
docker run -it duc11021102/text-to-speech-audio
- Run this command :
/m
- change mode (one .mp3 file or multiple .mp3 files)
/c
- check current language
/s
- enable/disable automatic audio playback
/*lang*
- change language, default language is Chinese (Traditional), check this file to use
Example: /vi
- change to Vietnamese
- Make add-on in Anki