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. 🐧 Instalacao do Piper TTS no Linux — Guia Passo a Passo

🐧 Instalacao do Piper TTS no Linux — Guia Passo a Passo

Scheduled Pinned Locked Moved Copy & Paste
1 Posts 1 Posters 2 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

    🗣️ O que é o Piper TTS?

    Piper é um motor de texto-para-fala (TTS) rápido, neural e totalmente local — roda 100% offline. Ele usa o espeak-ng para fonemização e funciona em qualquer distribuição Linux.

    Suporta mais de 40 idiomas, incluindo Português do Brasil (pt_BR), com vozes de alta qualidade.


    📥 Instalação no Linux

    1️⃣ Instalar Python 3.9+ e 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️⃣ Instalar o Piper

    pip install piper-tts
    

    💡 Recomendação: Use um ambiente virtual para evitar conflitos:

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

    3️⃣ Baixar uma voz

    python3 -m piper.download_voices
    

    Para baixar uma voz específica:

    # Português brasileiro
    python3 -m piper.download_voices pt_BR-edresson-medium
    
    # Inglês americano
    python3 -m piper.download_voices en_US-lessac-medium
    

    As vozes ficam disponíveis em huggingface.co/rhasspy/piper-voices.


    4️⃣ Testar a Voz

    python3 -m piper -m pt_BR-edresson-medium -f teste.wav -- "Ola! Esta e uma mensagem de teste do Piper TTS."
    

    Para ouvir diretamente (precisa do ffplay):

    # Instalar ffplay
    sudo apt install ffmpeg   # Debian/Ubuntu
    sudo dnf install ffmpeg   # Fedora
    
    # Testar
    python3 -m piper -m pt_BR-edresson-medium -- "Ola, mundo!"
    

    5️⃣ Usar a API Python

    import wave
    from piper import PiperVoice, SynthesisConfig
    
    voice = PiperVoice.load("pt_BR-edresson-medium.onnx")
    
    with wave.open("saida.wav", "wb") as wav_file:
        voice.synthesize_wav("Bem-vindo ao Piper TTS no Linux!", wav_file)
    
    syn_config = SynthesisConfig(
        volume=1.0,
        length_scale=1.1,
        noise_scale=0.9,
        normalize_audio=True
    )
    with wave.open("ajustado.wav", "wb") as w:
        voice.synthesize_wav("Frase personalizada...", w, syn_config=syn_config)
    

    6️⃣ Servidor HTTP (para uso continuo)

    Para evitar recarregar o modelo a cada frase, inicie o servidor:

    python3 -m piper.http_server
    

    Acesse em: http://localhost:5000

    Exemplo com curl:

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

    7️⃣ Aceleracao GPU (opcional)

    Com placa NVIDIA:

    pip install onnxruntime-gpu
    
    # No codigo
    voice = PiperVoice.load("voz.onnx", use_cuda=True)
    

    🎯 Dicas para Linux

    • Integracao com Home Assistant: O Piper e o motor TTS padrao do Home Assistant OS
    • Automacao: Use piper com scripts de shell para notificacoes por voz
    • Vozes em lote: cat frases.txt | python3 -m piper -m voz -f saida.wav
    • Binarios nativos (sem Python): Baixe de github.com/rhasspy/piper/releases para amd64/arm64/armv7

    Links uteis:

    • Amostras de vozes
    • Codigo fonte
    • Documentacao da API Python

    Duvidas? Pergunte aqui! 🚀

    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