saudi-msa-piper / lib /README.md
ISTNetworks's picture
Add library documentation
8318ee3 verified
# Piper Library Files
This directory contains the compiled library files required for Piper TTS to function correctly.
## Files
### espeakbridge.so (541 KB)
- **Purpose:** Bridge library for eSpeak-ng phonemization
- **Platform:** Linux x86_64
- **Python:** 3.11
- **Required:** Yes, for text-to-phoneme conversion
## Installation
### Option 1: Using pip (Recommended)
The easiest way is to install piper-tts via pip, which will compile the necessary libraries:
```bash
pip install piper-tts
```
### Option 2: Using the provided library
If you're on a compatible Linux system (x86_64, Python 3.11), you can use the provided library:
```bash
# Copy to your piper installation
cp lib/espeakbridge.so $(python3 -c "import piper; import os; print(os.path.dirname(piper.__file__))")
```
### Option 3: Build from source
For other platforms or Python versions, build from source:
```bash
git clone https://github.com/rhasspy/piper
cd piper/src/python
pip install -e .
```
## Platform Compatibility
The provided `espeakbridge.so` is compiled for:
- **OS:** Linux
- **Architecture:** x86_64
- **Python:** 3.11
For other platforms:
- **macOS:** Build from source or use pip install
- **Windows:** Use pip install (will download pre-built wheels)
- **Other Python versions:** Build from source or use pip install
## Troubleshooting
### ImportError: cannot import name 'espeakbridge'
This means the library is not in the correct location or is incompatible with your system.
**Solution:**
```bash
pip install --force-reinstall piper-tts
```
### OSError: lib/espeakbridge.so: cannot open shared object file
The library file is missing or in the wrong location.
**Solution:**
1. Ensure piper-tts is installed: `pip install piper-tts`
2. Or copy the library to the correct location (see Option 2 above)
### Wrong ELF class or architecture mismatch
The provided library is for x86_64 Linux. You need to build for your platform.
**Solution:**
```bash
pip install piper-tts # This will build for your platform
```
## Notes
- The library is platform and Python version specific
- When using pip install, the library is automatically compiled for your system
- The provided library is included for reference and quick setup on compatible systems
- For production use, we recommend using pip install to ensure compatibility