# PaddleSpeech

> One speech toolkit for recognition, synthesis, speaker verification and translation

- Category: Multimodal Generation / Audio, Music & Voice
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/PaddlePaddle/PaddleSpeech
- Website: https://paddlespeech.readthedocs.io
- Canonical page: https://ai-tldr.dev/tools/paddlespeech/

## In short

PaddleSpeech is an open-source speech and audio toolkit built on the PaddlePaddle deep-learning platform. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed Apache-2.0. To get started: install PaddlePaddle, then PaddleSpeech.

## Overview

PaddleSpeech is an open-source speech and audio toolkit built on the PaddlePaddle deep-learning platform. Rather than one model for one task, it packages the whole family: automatic speech recognition, text-to-speech, speaker verification, keyword spotting, audio classification, speech translation and punctuation restoration — each reachable from the same command-line tool and the same Python API. It won the NAACL 2022 Best Demo Award.

Two things distinguish it in practice. The first is production-ready streaming: the repository ships streaming ASR and streaming TTS servers, not just offline inference scripts, along with a C++ high-performance streaming deployment path and Android/ARM Linux demos. The second is its rule-based Chinese frontend — text normalisation and grapheme-to-phoneme conversion that handles polyphonic characters and tone sandhi, which is the part most Western TTS stacks leave out.

The project tracks mainstream research: Whisper large-v3 and turbo, Wav2vec2, WavLM, HuBERT and Squeezeformer for recognition; VITS, DiffSinger, ERNIE-SAT, voice cloning and singing-voice synthesis on the generation side; and recipes built on the usual datasets (LibriSpeech, AIShell, LJSpeech, CSMSC). It is Apache-2.0 licensed and recommended on Linux with Python 3.8 or newer.

## What it does

- One CLI and Python API across ASR, TTS, speaker verification, keyword spotting, audio classification, speech translation and punctuation restoration
- Production-ready streaming ASR and streaming TTS servers, plus C++ high-performance streaming deployment
- Rule-based Chinese frontend with text normalisation and grapheme-to-phoneme, including polyphone and tone sandhi handling
- Modern model coverage: Whisper large-v3 and turbo, Wav2vec2, WavLM, HuBERT, Squeezeformer, VITS, DiffSinger, ERNIE-SAT
- Voice cloning, TTS fine-tuning and singing-voice synthesis recipes
- ONNX export for TTS models and on-device demos for Android and ARM Linux

## Getting started

PaddleSpeech depends on PaddlePaddle, so install the framework first and pick the build (CPU or GPU) that matches your machine. All commands below come from the project README.

1. Install PaddlePaddle, then PaddleSpeech

   The CPU build is shown here; choose the matching GPU wheel from the PaddlePaddle site if you have one.

```bash
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
pip install pytest-runner
pip install paddlespeech
```

2. Grab a test clip

   The README's examples use these two 16 kHz wav samples.

```bash
wget -c https://paddlespeech.cdn.bcebos.com/PaddleAudio/zh.wav
wget -c https://paddlespeech.cdn.bcebos.com/PaddleAudio/en.wav
```

3. Transcribe audio

   One command per task — swap `--input` for your own 16 kHz wav file.

```bash
paddlespeech asr --lang zh --input zh.wav
```

4. Synthesise speech

   Text in, wav out, using the bundled Chinese frontend.

```bash
paddlespeech tts --input "你好，欢迎使用百度飞桨深度学习框架！" --output output.wav
```

5. Use the other tasks the same way

   Audio classification, speaker (voiceprint) extraction and punctuation restoration follow the same shape.

```bash
paddlespeech cls --input zh.wav
paddlespeech vector --task spk --input zh.wav
paddlespeech text --task punc --input 今天的天气真不错啊你下午有空吗我想约你一起去吃饭
```

6. Or build from source

   Source compilation is the recommended route when you plan to train or modify recipes.

```bash
git clone https://github.com/PaddlePaddle/PaddleSpeech.git
cd PaddleSpeech
pip install pytest-runner
pip install .
```

## When to use it

- Reach for it when one project needs several speech tasks and you would rather not stitch four toolkits together
- Reach for it for Chinese or Chinese-English code-switching speech, where its text frontend does the work others skip
- Reach for it when you need a streaming ASR or TTS server rather than batch inference
- Reach for it to fine-tune TTS voices or run voice cloning from documented recipes
