Skip to main content

Installation

This guide will help you install TTS Wrapper and its dependencies. The library is published on PyPI as py3-tts-wrapper but installs as tts_wrapper in your Python environment.

Basic Installation​

Install the core package with pip:

pip install py3-tts-wrapper

Installation with Specific Engines​

You can install TTS Wrapper with support for specific engines:

# Install with all cloud service engines
pip install "py3-tts-wrapper[google,watson,polly,microsoft,elevenlabs,witai,playht]"

# Install with local engines
pip install "py3-tts-wrapper[espeak,sapi,sherpaonnx,avsynth]"

# Install with specific engines (example)
pip install "py3-tts-wrapper[google,microsoft,sapi,sherpaonnx]"

Note: On macOS/zsh, you need to use quotes around the package name and extras.

important

Note: If you want to control audio playback (e.g., pause and resume functionality), you need to install the controllable extra. Without this extra, playback control features will not work.

Available Extras​

ExtraDescriptionAdditional Dependencies
googleGoogle Cloud TTS supportgoogle-cloud-texttospeech
watsonIBM Watson TTS supportibm-watson, websocket-client
pollyAWS Polly supportboto3
microsoftMicrosoft Azure TTS supportazure-cognitiveservices-speech
elevenlabsElevenLabs TTS support-
witaiWit.ai TTS support-
playhtPlay.HT TTS support-
sapiWindows SAPI supportcomtypes (Windows only)
sherpaonnxSherpa-ONNX supportsherpa-onnx
googletransGoogle Translate TTS supportgTTS
controlaudioAdvanced audio controlpyaudio
espeakeSpeak-NG support-
avsynthmacOS AVSpeechSynthesizer support-
uwpWindows UWP speech supportwinrt-runtime (Windows only)

System Requirements​

  • Python 3.10 or higher
  • Operating system: Windows, macOS, or Linux
  • System dependencies (varies by platform)

System Dependencies​

Linux (Ubuntu/Debian)​

# Core dependencies
sudo apt-get update
sudo apt-get install -y portaudio19-dev

# For eSpeak support
sudo apt-get install -y espeak-ng

# For PicoTTS support (optional)
sudo apt-get install -y libttspico-utils

# For audio playback
sudo apt-get install -y ffmpeg

macOS​

Using Homebrew:

# Core dependencies
brew install portaudio

# For eSpeak support
brew install espeak-ng

# For audio playback
brew install ffmpeg

Windows​

  • Download and install eSpeak-NG if you plan to use eSpeak
  • SAPI and UWP engines use built-in Windows components

Troubleshooting​

Common Issues​

  1. PortAudio errors:

    • Ensure you've installed the PortAudio development libraries
    • On Linux: sudo apt-get install portaudio19-dev
    • On macOS: brew install portaudio
  2. eSpeak not found:

    • Verify eSpeak-NG is installed and in your system PATH
    • On Linux: sudo apt-get install espeak-ng
    • On macOS: brew install espeak-ng
    • On Windows: Install from the official website
  3. SSL Certificate Verification:

    • For Watson TTS, if you encounter SSL issues, you can disable verification:
      client = WatsonClient(credentials=(...), disableSSLVerification=True)
  4. Windows SAPI Issues:

    • Ensure you're running Python with appropriate permissions
    • Verify the comtypes package is installed

Getting Help​

If you encounter any issues:

  1. Check the GitHub Issues for similar problems
  2. Ensure all system dependencies are correctly installed
  3. Verify you're using a supported Python version (3.10 or higher)
  4. Create a new issue with detailed information about your setup and the error

Next Steps​

Once you have TTS Wrapper installed, check out the Basic Usage guide to learn how to use the library.