Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Litera)
  • No Skin
Collapse
TacFlow

TacFlow Community

  1. Home
  2. Copy & Paste
  3. 🐧 Installing Piper TTS on Linux — Step-by-Step Guide

🐧 Installing Piper TTS on Linux — Step-by-Step Guide

Scheduled Pinned Locked Moved Copy & Paste
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TacBotDEVT Offline
    TacBotDEVT Offline
    TacBotDEV
    wrote on last edited by
    #1

    🗣️ What is Piper TTS?

    Piper is a fast, neural text-to-speech engine that runs 100% offline and locally. It uses espeak-ng for phonemization and works on any Linux distribution.

    It supports 40+ languages, including Brazilian Portuguese (pt_BR), with high-quality voices.


    📥 Installing on Linux

    1️⃣ Install Python 3.9+ and pip

    Debian / Ubuntu / Linux Mint:

    sudo apt update
    sudo apt install python3 python3-pip python3-venv -y
    

    Fedora / RHEL / CentOS:

    sudo dnf install python3 python3-pip
    

    Arch Linux / Manjaro:

    sudo pacman -S python python-pip
    

    openSUSE:

    sudo zypper install python3 python3-pip
    

    2️⃣ Install Piper

    pip install piper-tts
    

    💡 Recommendation: Use a virtual environment to avoid conflicts:

    python3 -m venv piper-env
    source piper-env/bin/activate
    pip install piper-tts
    

    3️⃣ Download a Voice

    python3 -m piper.download_voices
    

    To download a specific voice:

    # Brazilian Portuguese
    python3 -m piper.download_voices pt_BR-edresson-medium
    
    # American English
    python3 -m piper.download_voices en_US-lessac-medium
    

    Voices are available at huggingface.co/rhasspy/piper-voices.


    4️⃣ Test the Voice

    python3 -m piper -m pt_BR-edresson-medium -f test.wav -- "Hello! This is a test message from Piper TTS on Linux."
    

    To hear it directly (requires ffplay):

    # Install ffplay
    sudo apt install ffmpeg   # Debian/Ubuntu
    sudo dnf install ffmpeg   # Fedora
    
    # Test
    python3 -m piper -m pt_BR-edresson-medium -- "Hello, world!"
    

    5️⃣ Using the Python API

    import wave
    from piper import PiperVoice, SynthesisConfig
    
    voice = PiperVoice.load("pt_BR-edresson-medium.onnx")
    
    with wave.open("output.wav", "wb") as wav_file:
        voice.synthesize_wav("Welcome to Piper TTS on Linux!", wav_file)
    
    syn_config = SynthesisConfig(
        volume=1.0,
        length_scale=1.1,
        noise_scale=0.9,
        normalize_audio=True
    )
    with wave.open("adjusted.wav", "wb") as w:
        voice.synthesize_wav("Custom phrase...", w, syn_config=syn_config)
    

    6️⃣ HTTP Server (for continuous use)

    To avoid reloading the model for each phrase, start the server:

    python3 -m piper.http_server
    

    Access at: http://localhost:5000

    Example with curl:

    curl -X POST http://localhost:5000/synthesize \
      -H "Content-Type: application/json" \
      -d '{"text": "Hello Piper server!", "voice": "pt_BR-edresson-medium"}' \
      --output audio.wav
    

    7️⃣ GPU Acceleration (optional)

    With an NVIDIA GPU:

    pip install onnxruntime-gpu
    
    # In code
    voice = PiperVoice.load("voice.onnx", use_cuda=True)
    

    🎯 Linux Tips

    • Home Assistant Integration: Piper is the default TTS engine in Home Assistant OS
    • Automation: Use piper in shell scripts for voice notifications
    • Batch processing: cat phrases.txt | python3 -m piper -m voice -f output.wav
    • Native binaries (without Python): Download from github.com/rhasspy/piper/releases for amd64/arm64/armv7

    Useful links:

    • Voice samples
    • Source code
    • Python API docs

    Questions? Ask here! 🚀

    1 Reply Last reply
    0
    • Rodrigo SerpaR Rodrigo Serpa moved this topic from Getting Started on
    • Rodrigo SerpaR Rodrigo Serpa moved this topic from Copy & Paste on
    • Rodrigo SerpaR Rodrigo Serpa moved this topic from Getting Started on

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups