Skip to content

duc11021102/pyspeech

Repository files navigation

PySpeech

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

Quick start

The simplest method is to install the portable version using the .exe file, available at this link.
Or install with python:

Requirements

  • Python (pip v25 or newer, python v3.10 or newer)
  • Python Libraries: gTTS pygame pyinstaller

Setup

  • 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 open tts-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

Setup with Docker

  • Pull and run:

    • Run this command : docker pull duc11021102/text-to-speech-audio
    • Run this command : docker run -it duc11021102/text-to-speech-audio

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

Plans for future

  • Make add-on in Anki