---
title: "Piper | Micdrop"
description: "Local text to speech with Piper, covering around forty languages."
url: "https://micdrop.dev/docs/ai-integration/provided-integrations/piper"
---

*   [Getting Started](/docs/getting-started)
*   [Client (Browser)](/docs/client)
    
    *   [Installation](/docs/client/installation)
    *   [React Hooks](/docs/client/react-hooks)
    *   [Start/Stop Call](/docs/client/start-stop-call)
    *   [Pause/Resume Call](/docs/client/pause-resume-call)
    *   [Mute/Unmute Call](/docs/client/mute-unmute-call)
    *   [Call State](/docs/client/call-state)
    *   [Display Conversation Messages](/docs/client/display-conversation-messages)
    *   [Handling Tool Calls](/docs/client/handling-tool-calls)
    *   [Device Management](/docs/client/devices-management)
    *   [Voice Activity Detection (VAD)](/docs/client/vad)
    *   [Error Handling](/docs/client/error-handling)
    *   Utility Classes
        
        *   [Mic](/docs/client/utility-classes/mic)
        *   [MicdropClient](/docs/client/utility-classes/micdrop-client)
        *   [MicRecorder](/docs/client/utility-classes/mic-recorder)
        *   [Speaker](/docs/client/utility-classes/speaker)
        
    
*   [Server (Node.js)](/docs/server)
    
    *   [Installation](/docs/server/installation)
    *   [With Fastify](/docs/server/with-fastify)
    *   [With NestJS](/docs/server/with-nestjs)
    *   [Auth and Parameters](/docs/server/auth-and-parameters)
    *   [First Message](/docs/server/first-message)
    *   [Save Messages](/docs/server/save-messages)
    *   [Resume a Conversation](/docs/server/resume-conversation)
    *   [Recording Audio](/docs/server/recording-audio)
    *   [Error Handling](/docs/server/error-handling)
    *   [Tools](/docs/server/tools)
    *   [Extract Value from Answer](/docs/server/extract)
    *   [Auto End Call](/docs/server/auto-end-call)
    *   [Semantic Turn Detection](/docs/server/semantic-turn-detection)
    *   [Noise Filtering](/docs/server/noise-filtering)
    *   [Micdrop Protocol](/docs/server/protocol)
    
*   [AI Integrations](/docs/ai-integration)
    
    *   Provided Integrations
        
        *   [AI SDK](/docs/ai-integration/provided-integrations/ai-sdk)
        *   [Cartesia](/docs/ai-integration/provided-integrations/cartesia)
        *   [ElevenLabs](/docs/ai-integration/provided-integrations/elevenlabs)
        *   [Gladia](/docs/ai-integration/provided-integrations/gladia)
        *   [Gradium](/docs/ai-integration/provided-integrations/gradium)
        *   [Kokoro](/docs/ai-integration/provided-integrations/kokoro)
        *   [Mistral](/docs/ai-integration/provided-integrations/mistral)
        *   [OpenAI](/docs/ai-integration/provided-integrations/openai)
        *   [Piper](/docs/ai-integration/provided-integrations/piper)
        *   [Whisper](/docs/ai-integration/provided-integrations/whisper)
        
    *   Custom Integrations
        
        *   [Agent (LLM)](/docs/ai-integration/custom-integrations/custom-agent)
        *   [Speech-to-Text (STT)](/docs/ai-integration/custom-integrations/custom-stt)
        *   [Text-to-Speech (TTS)](/docs/ai-integration/custom-integrations/custom-tts)
        
    *   Fallback Strategies
        
        *   [FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)
        *   [FallbackSTT](/docs/ai-integration/fallback-strategies/stt-fallback)
        *   [FallbackTTS](/docs/ai-integration/fallback-strategies/tts-fallback)
        
    *   [Local Models](/docs/ai-integration/local-models)
    *   [IA Vocale Souveraine 🇫🇷🇪🇺](/docs/ai-integration/sovereign-voice-ai)
    

[Micdrop](/) › [Documentation](/docs/getting-started)

# Piper

Local text to speech for [@micdrop/server](/docs/server), driving the [Piper](https://github.com/OHF-Voice/piper1-gpl) binary as a subprocess.

Piper voices are small VITS models, a few dozen megabytes each, covering around forty languages including French. They generate much faster than real time even on a modest CPU, which makes Piper the option to reach for outside English, where [Kokoro](/docs/ai-integration/provided-integrations/kokoro) sounds better but only speaks English.

## Installation

Install the package:

Terminal window

```
npm install @micdrop/piper
```

Install the binary:

Terminal window

```
pip install piper-tts
```

Then download a voice, which comes as a pair of files that have to sit next to each other:

Terminal window

```
mkdir -p voices && cd voicesBASE=https://huggingface.co/rhasspy/piper-voices/resolve/main/fr/fr_FR/siwis/mediumcurl -LO $BASE/fr_FR-siwis-medium.onnxcurl -LO $BASE/fr_FR-siwis-medium.onnx.json
```

Piper ships a `download_voices` module, but calling it means finding the exact interpreter `pip` installed it under, which is rarely the `python3` in your path. Downloading the two files is shorter and works the same.

## Usage

```
import { PiperTTS } from '@micdrop/piper'import { MicdropServer } from '@micdrop/server'
const tts = new PiperTTS({  modelPath: './voices/fr_FR-siwis-medium.onnx',})
// Use with MicdropServernew MicdropServer(socket, {  tts,  // ... other options})
```

## Options

Option

Type

Default

Description

`modelPath`

`string`

Required

Path to the `.onnx` voice file

`configPath`

`string`

`<modelPath>.json`

Voice configuration

`binaryPath`

`string`

`'piper'` in `PATH`

Piper executable

`speaker`

`number`

Optional

Speaker index, for the voices holding several

`lengthScale`

`number`

Optional

Duration multiplier, above 1 to slow the voice down

`noiseScale`

`number`

Optional

Variability of the generated speech

`noiseWidth`

`number`

Optional

Variability of the phoneme durations

`sentenceSilence`

`number`

Optional

Silence added after each sentence, in seconds

## Voices

Voices are named after their language, their speaker and their quality, such as `fr_FR-siwis-medium` or `en_GB-alba-medium`. The [voice samples page](https://rhasspy.github.io/piper-samples/) lets you listen to them before downloading.

Each voice ships as `<name>.onnx` and `<name>.onnx.json`, which have to sit next to each other. The JSON file carries the sample rate the model generates at, read at startup so the audio reaches the client at the rate it expects.

## How the process is driven

One process is spawned per sentence: its exit is what marks the end of that sentence’s audio, and killing it is what makes an interruption immediate. Loading a voice costs on the order of a hundred milliseconds, paid while the previous sentence is still being played by the client.

Piper generates much faster than real time, so the whole answer is usually ready before the user has finished hearing its first sentence.

## Documentation

Read the [guide on running Micdrop with local models](/docs/ai-integration/local-models) to see how this fits with a local LLM and a local transcription.

## License

Piper is released under the MIT license, and its voices under permissive licenses that vary by voice.

[Previous← OpenAI](/docs/ai-integration/provided-integrations/openai)[NextWhisper →](/docs/ai-integration/provided-integrations/whisper)

On this page

*   [Installation](#installation)
*   [Usage](#usage)
*   [Options](#options)
*   [Voices](#voices)
*   [How the process is driven](#how-the-process-is-driven)
*   [Documentation](#documentation)
*   [License](#license)
