A Visual Studio Code extension that adds high-quality local text-to-speech capabilities using Piper.
- Read Selected Text Aloud: Easily convert selected text to speech with a single command
- Multiple Languages and Voices: Support for 40+ languages with 100+ voice options
- Local Processing: All text-to-speech processing happens locally on your machine, with no data sent to external servers
- Cross-Platform: Works on Windows, macOS, and Linux
- Voice Management: Download additional voices or remove existing ones
- API for Other Extensions: Can be used by other VS Code extensions
- Install the extension from the Visual Studio Code Marketplace
- The extension comes with two default English voices pre-installed:
en_US-hfc_female-medium
(default)en_US-hfc_male-medium
- Select text in the editor
- Right-click and select "Read Aloud Text" from the context menu, or:
- Open the Command Palette (
Ctrl+Shift+P
/Cmd+Shift+P
) and run "Piper TTS: Read Aloud Text"
- Right-click in the editor and select "Stop Reading", or:
- Open the Command Palette and run "Piper TTS: Stop Reading"
- Open the Command Palette and run "Piper TTS: Select Voice"
- Choose from the available installed voices
- Open the Command Palette and run "Piper TTS: Download Voice"
- Select a language, voice, and model size
- Wait for the download to complete
- Open the Command Palette and run "Piper TTS: Remove Voice"
- Select the voice you want to remove
The extension supports over 100 voices across 40+ languages. Some of the supported languages include:
- Arabic (ar_JO)
- Catalan (ca_ES)
- Czech (cs_CZ)
- Danish (da_DK)
- Dutch (nl_BE, nl_NL)
- English (en_GB, en_US)
- Finnish (fi_FI)
- French (fr_FR)
- German (de_DE)
- Greek (el_GR)
- Hungarian (hu_HU)
- Icelandic (is_IS)
- Italian (it_IT)
- Kazakh (kk_KZ)
- Norwegian (no_NO)
- Polish (pl_PL)
- Portuguese (pt_BR, pt_PT)
- Romanian (ro_RO)
- Russian (ru_RU)
- Spanish (es_ES, es_MX)
- Swedish (sv_SE)
- Turkish (tr_TR)
- Ukrainian (uk_UA)
- Vietnamese (vi_VN)
- Chinese (zh_CN)
- And many more...
Each language offers multiple voice options with different quality levels (x_low, low, medium, high).
Voices come in different quality levels, which affect both the speech quality and resource usage:
- x_low: Smallest models, fastest processing, lowest quality
- low: Small models, fast processing, decent quality
- medium: Balanced models, good quality with reasonable resource usage
- high: Largest models, highest quality, but more resource-intensive
Other VS Code extensions can use Piper TTS functionality by accessing its API. See API_USAGE.md for details.
piper-tts.voice
: The voice model to use for text-to-speech
- Functionality on MacOS is not fully tested, but should work. Please report any issues you encounter.
This extension is licensed under the terms of the MIT LICENSE.
If you would like to contribute to this project, please fork the repository and submit a pull request. Contributions are welcome!
- Piper - The text-to-speech engine used by this extension
- Sox - Used for audio processing on Windows
- Voice models are sourced from the Piper voices collection