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
BarkTransformer-based text-to-audio model.
sherpa-onnxSpeech-to-text and text-to-speech software
Coqui TTSOffers pretrained models in more than 1,100 different languages
Dia1.6B parameter text to speech model
TortoiseMulti-voice text-to-speech system trained with an emphasis on quality
FestivalGeneral multi-lingual speech synthesis system
PraatSpeechAnalyserSoftware for speech analysis and synthesis
ChatterboxFamily of text-to-speech models
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 carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted