Skip to content
| Marketplace
Sign in
Visual Studio Code>Machine Learning>Piper ReaderNew to Visual Studio Code? Get it now.
Piper Reader

Piper Reader

Lines

|
1 install
| (0) | Free
Read files aloud using piper-tts via piper-reader
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

piper-reader

Read any text or markdown file aloud using piper-tts - a fast, local, offline text-to-speech engine. Available as a VSCodium/VS Code extension and a standalone CLI script.

Features

  • Reads plain text and markdown files aloud via piper-tts (own installation, called via wrapper)
  • Strips markdown syntax before speaking (no asterisks, hashes, or bracket noise)
  • Paragraph-by-paragraph generation with progress display
  • Pitch-preserving speed control via sox tempo (settings)
  • Pause and resume playback at the exact audio position
  • Save output to WAV file
  • Download voice models directly from Hugging Face
  • VSCodium/VS Code extension with context-aware tab menu (no keyboard shortcuts for now, sorry!)
  • Screenshot - Tab menu
  • Screenshot - Reader settings
  • Screenshot - Reader playing
  • Screenshot - Reader paused
  • Screenshot - Reader playing- CLI

Platform Compatibility

Platform Status Notes
Linux Supported Fully tested
macOS Supported Requires brew install sox and pip install piper-tts
Windows Not supported Requires bash and sox; WSL audio routing is not officially supported

Why?

This project started out of frustration - I just wanted a simple way to listen to long Markdown files, technical documentation, notes, and personal write-ups while doing something else. I assumed there would already be a lightweight extension for VSCodium that worked offline with Piper TTS - but there wasn't.

Most text-to-speech extensions I found depended on cloud services, browser APIs, subscriptions, API keys, or online accounts. Others were difficult to configure, weren't available in the Open VSX marketplace, or simply didn't fit the workflow I wanted. While offline and local-first TTS tools are becoming more common, many solutions still focus on web services or broader platforms rather than a simple editor integration.

So I stopped searching, and started building. Piper Reader is the tool I wanted to install (I think lol):

  • Read Markdown and text files directly from the editor.
  • Completely offline.
  • No API keys.
  • No subscriptions.
  • No accounts.
  • Uses your own local Piper voice models (download it yourself).
  • Simple enough to set up once and forget about.

If it saves someone else from spending an evening searching through extension marketplaces like I did, then building it was worth it.

This isn't trying to be the most feature-rich TTS extension. It's trying to be the one that gets out of your way and lets you listen to your documents.


VSCodium / VS Code Extension

Installation

Install from VSIX:

codium --install-extension piper-reader-0.0.x.vsix

Or via the UI: Extensions panel -> ... -> "Install from VSIX..."

Requirements

  • piper-tts -- pip install piper-tts
  • sox -- sudo dnf install sox (Linux) / brew install sox (macOS)
  • At least one piper voice model (.onnx + .onnx.json)

Windows: not supported. The extension relies on a bash script and sox for audio playback. WSL is not officially supported either.

Setup

Open Settings (Ctrl+,) and search for Piper Reader. Set at minimum:

Setting Description
piperReader.voicesDir Required. Path to your voice models directory (e.g. /home/user/voices)
piperReader.model Voice model bare name (e.g.en_US-amy-medium) or full path

Usage

Right-click any open editor tab. The menu adapts to the current playback state:

State Available commands
Idle Piper Read, Piper Save
Playing Piper Pause, Piper Stop
Paused Piper Resume, Piper Stop
Command Action
Piper Read Read the file aloud, or read the current selection if text is selected
Piper Pause Freeze playback at the exact audio position
Piper Resume Continue from exactly where it was paused
Piper Stop Stop playback entirely and reset state
Piper Save Render to WAV -- opens a save dialog

Click the status bar item (shown while reading) to stop playback at any time. The status bar shows per-paragraph progress ([1/5] playing...) while active, and Paused [N/M] when frozen.

Screenshot - Reader playing Screenshot - Reader paused Screenshot - Reader playing- CLI

Selection mode: highlight any text in the active editor before invoking Piper Read and only the selected text will be spoken. If nothing is selected, the whole file is read.

All Settings

Setting Default Description
piperReader.voicesDir (empty) Directory containing voice model.onnx files
piperReader.model en_US-amy-medium Voice model name or full path
piperReader.lengthScale 1.0 Phoneme length / speed (higher = slower)
piperReader.noiseScale 0.9 Expressiveness / variation
piperReader.noiseW 0.85 Phoneme width noise
piperReader.sentenceSilence 0.4 Seconds of silence after each sentence
piperReader.volume 0.75 Volume multiplier
piperReader.tempo 1.1 Pitch-preserving speed (1.0=normal, 0.9=10% slower)
piperReader.soxGain -1 Sox gain in dB to prevent clipping
piperReader.speaker (empty) Speaker ID for multi-speaker models
piperReader.piperPath (empty) Absolute path to the piper executable. Set this if VSCodium cannot find piper at runtime (e.g. installed via pip install --user on a system with restricted GUI app PATH). Leave empty to use piper from PATH.

CLI Usage

Requirements

Dependency Linux macOS
piper-tts pip install piper-tts pip install piper-tts
sox sudo dnf install sox brew install sox
curl Usually pre-installed Pre-installed

Windows: not supported. The script requires bash and sox. Windows users would need WSL, but audio routing via WSL is not officially supported.

Install

git clone https://github.com/linellazatin/piper-tts-reader.git
cd piper-tts-reader
chmod +x piper-reader

Optionally symlink to PATH:

ln -s "$PWD/piper-reader" ~/.local/bin/piper-reader

Configuration

VOICES_DIR has no baked-in default. You must set it before using --list, --download, or reading any file, or you will get an error. Do this in one of three ways:

Option A -- conf file beside the script (recommended for CLI use):

# piper-reader.conf
MODEL=en_US-amy-medium
VOICES_DIR=/path/to/your/voices

Option B -- env var pointing to any config file:

export PIPER_READER_CONFIG=/path/to/my-piper.conf

Option C -- CLI flag per invocation:

./piper-reader --voices-dir /path/to/your/voices notes.md

Full config reference:

MODEL=en_US-amy-medium
VOICES_DIR=/path/to/voices
LENGTH_SCALE=1.0
NOISE_SCALE=0.9
NOISE_W_SCALE=0.85
SENTENCE_SILENCE=0.4
VOLUME=0.75
SOX_GAIN=-1
TEMPO=1.1
SAMPLE_RATE=22050

Config resolution order:

  1. PIPER_READER_CONFIG env var (if set, path to a config file)
  2. piper-reader.conf beside the script (if present)
  3. Baked-in defaults (no VOICES_DIR -- must be set explicitly)

All values can be overridden per-invocation via CLI flags.

Examples

# Read a file aloud
./piper-reader notes.md

# Read from stdin
echo "Hello world" | ./piper-reader
cat article.txt | ./piper-reader

# Tune voice on the fly
./piper-reader --noise-scale 0.9 --tempo 0.95 notes.md

# Save to WAV instead of playing
./piper-reader --output speech.wav notes.md

# Use a specific model
./piper-reader --model en_US-lessac-high notes.md

# Multi-speaker model
./piper-reader --model en_US-libritts-high --speaker 5 notes.md

# List downloaded models
./piper-reader --list

# Download a model
./piper-reader --download en_US-amy-medium

Flag Reference

Flag Description
-m, --model MODEL Model path or bare name (resolved againstVOICES_DIR)
--voices-dir DIR Directory containing voice models
-l, --length-scale N Phoneme length / speed (higher = slower)
-n, --noise-scale N Generator noise / expressiveness
-w, --noise-w N Phoneme width noise
-s, --speaker ID Speaker ID for multi-speaker models
--sentence-silence N Seconds of silence after each sentence
--volume N Volume multiplier
--tempo N Pitch-preserving speed (1.0=normal, 0.9=10% slower)
--sox-gain N Sox gain in dB to prevent clipping
--no-normalize Disable piper audio normalization
-o, --output FILE.wav Save to WAV instead of playing
--download NAME Download model from rhasspy/piper-voices
--list List available models inVOICES_DIR
--debug Enable piper debug output
-h, --help Show help

Markdown Stripping

The following is stripped before text reaches piper:

  • Fenced code blocks
  • Inline code backticks (content kept)
  • Headers
  • Bold (**text**, __text__)
  • Images (removed entirely)
  • Links (link text kept)
  • HTML tags
  • Horizontal rules

Voice Models

Browse and audition voices at rhasspy.github.io/piper-samples.

Download via CLI (requires VOICES_DIR to be set in your config, or pass --voices-dir):

./piper-reader --download en_US-amy-medium
./piper-reader --download en_US-ryan-high

# or without a config file:
./piper-reader --voices-dir ~/voices --download en_US-amy-medium

Or browse the full list at huggingface.co/rhasspy/piper-voices.


License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft