-
Python
a. Check version
python --versionb. Install if needed
sudo apt update && sudo apt install python3
-
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.
- 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).
- 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)
-
Audio Libraries (Optional)
a. For audio playback testing:sudo apt install alsa-utils
b. Test with:
aplay output.wav
sudo apt update
python3 piper_tts_script.py
- 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
- Download from HERE
- Make sure you download both: onnx file and json file (within the script directory)
-
Place your .txt file, .onnx model, and .json config in the script directory
-
Run:
python3 piper_tts_script.py -
Script will automatically download and setup Piper binary
-
Follow prompts to select text file (if multiple exist)
-
Output .wav file will be created with same name as input .txt file