Skip to content

Ackberry/piperttsapi

Repository files navigation

Documentation to initialize and run Piper TTS in Linux Operating System

Pre-requisites

  1. Python

    a. Check version

    python --version
    

    b. Install if needed

    sudo apt update && sudo apt install python3
    



  1. Required Python Modules

    a. All the neccessary modules are a part of the python standard library
       os, sys, tarfile, urllib.request, shutil, glob, subprocess

    b. Any additional pip installations are not required.




  1. File Permissions and Directory

    a. Permissions to write in the script directory

    b. By default, the given script would set executable permissions. However, writing permissions can be
        manually allocated should there be any problems. Read More

    c. Make sure that all the downloaded files (script, voice module (.onnx) and config (.json) files are in the same directory).



  1. System Architecture

    a. ARM64 (aarch64) - for Raspberry Pi 4/5

    b. x86_64 - for standard Linux PCs

    c. Script currently configured for ARM64 (Raspberry Pi)



  1. Audio Libraries (Optional)
    a. For audio playback testing:

     sudo apt install alsa-utils
    

    b. Test with:

    aplay output.wav 
    



Quick Update commands

sudo apt update
python3 piper_tts_script.py



Troubleshooting

  • If permission errors occur, ensure you have write access to the directory
  • If download fails, check internet connection and firewall settings
  • For audio issues, check ALSA configuration:
    aplay -l
    



Supported Voice Models

  • Download from HERE
  • Make sure you download both: onnx file and json file (within the script directory)



First Run

  1. Place your .txt file, .onnx model, and .json config in the script directory

  2. Run:

    python3 piper_tts_script.py
    
  3. Script will automatically download and setup Piper binary

  4. Follow prompts to select text file (if multiple exist)

  5. Output .wav file will be created with same name as input .txt file

About

Piper API (in python) to simplify the process.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages