Speech

Machine Learning in Linux: Piper

Last Updated on April 1, 2026

In Operation

Let’s send some text from our website and pipe that to piper.

$ more LinuxLinks.txt | piper --cuda --model en_GB-alba-medium --output_file LinuxLinks-Intro-Machine-Learning.wav

Intonation is very good although not perfect.

As you see, the command uses three options:

--cuda instructs piper to use the GPU for much faster processing compared to using the CPU.

--model tells Piper which language and voice to use. Piper offers a fairly wide range of languages including English, Czech, French, Italian, Spanish, Danish, Chinese, Swedish, and others. For each language there are different voices. For example, English (British) offers 8 different voices. In the sample above, we’re using the alba voice. Voices are trained at one of 4 ‘quality’ levels. The alba voice is available at the medium quality level which is using a samplerate of 22,050 Hz, 15-20 params. Alba is the Scottish Gaelic name for Scotland.

--output_file is self-explanatory.

Let’s repeat using an American voice.

$ more LinuxLinks.txt | piper --cuda --model en_US-lessac-high --output_file LinuxLinks-Intro-Machine-Learning-American-voice.wav

The voice is trained at the high quality level (sample rate 22,050 Hz audio, 28-32M params).


Summary

Piper is highly recommended.

From our tests, the software is very fast and lightweight which even performs well even on inexpensive single-board computers such as the Raspberry Pi 4. The project provides binaries for 64-bit desktop Linux, 64-bit Raspberry Pi 4, and 32-bit Raspberry Pi 3/4.

The pre-built models are very good, but you’ll probably want to train a voice for Piper. This is a 3-step process requiring preparation of the dataset, training the voice model, and then exporting the voice model.

The software can stream raw audio to stdout, and it also accepts JSON input, a standard text-based format for representing structured data based on JavaScript object syntax. If you want to stream a lot of text, it’s best to use --output_raw.

Piper doesn’t offer a graphical frontend, but we’ll shortly publish a review of software that offers such a frontend.

Website: github.com/OHF-Voice/piper1-gpl
Support:
Developer: Michael Hansen
License: GNU General Public License v3.0 (MIT License when reviewed)

Artificial intelligence icon For other useful open source apps that use machine learning/deep learning, we’ve compiled this roundup.

Piper is written in C++ and Python. Learn C++ with our recommended free books and free tutorials. Learn Python with our recommended free books and free tutorials.

Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary


Related Software

Speech Tools
PiperFast, local neural text to speech system
TortoiseMulti-voice text-to-speech system trained with an emphasis on quality
Coqui TTSOffers pretrained models in more than 1,100 different languages
BarkTransformer-based text-to-audio model.
Dia1.6B parameter text to speech model
FestivalGeneral multi-lingual speech synthesis system
PraatSpeechAnalyserSoftware for speech analysis and synthesis
Speech NoteSpeech to Text, Text to Speech and Machine Translation
Mimic 3Lightweight Text to Speech engine
OrcaScreenReaderScriptable screen reader
MeloTTSHigh-quality multi-lingual text-to-speech library
Parler-TTSLightweight text-to-speech (TTS) model
FliteSmall, fast run time text to speech synthesis engine
RHVoiceGives the visually impaired a synthesis voice with their screen reader
eSpeak NGContinuation of the eSpeak project
eSpeakSpeech synthesizer using a formant synthesis method
Orpheus-TTS-FastAPIHigh-performance self-hosted text-to-speech server
GespeakerGTK-based frontend for eSpeak
VoiceGenSimple text-to-speech application
GlateGoogle Translator and Text To Speech Service

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted