PaddleSpeech

PaddlePaddleApache-2.0活跃维护

开箱即用的语音工具包,覆盖流式语音识别、语音合成、声纹识别、语音翻译和关键词唤醒,自带标点恢复与文本前端,适合快速搭建语音推理服务。

Easy-to-use Speech Toolkit including Self-Supervised Learning model, SOTA/Streaming ASR with punctuation, Streaming TTS with text frontend, Speaker Verification System, End-to-End Speech Translation and Keyword Spotting. Won NAACL2022 Best Demo Award.

r1.5.0发布于 2025-03-05 07:11 UTC12,706star +2 / 7 天1,952fork同步于 2026-11-10 17:28 UTC

怎么上手

由 README 提炼,执行前请确认
pip install pytest-runner
pip install paddlespeech
硬件要求按 README 说明

README 未说明显存要求;支持 Linux(推荐)、Windows、Mac OSX,依赖 paddlepaddle,可按机器选择 CPU 版本安装。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于飞桨的语音工具包,覆盖识别、合成、翻译等任务,开箱即用

开箱即用的语音工具包,覆盖流式语音识别、语音合成、声纹识别、语音翻译和关键词唤醒,自带标点恢复与文本前端,适合快速搭建语音推理服务。

核心能力

  • 提供 ASR、TTS、声纹、音频分类等命令行与 Python API
  • 支持带标点恢复的流式语音识别
  • 流式 TTS 带文本前端,可输出 24k 采样率音频
  • 提供服务端与流式服务端部署方式
  • 支持端到端语音翻译与关键词检测

容易踩的坑

需先单独安装 paddlepaddle,版本要匹配;源码编译安装推荐,可编辑模式需加 --use-pep517;示例音频需自行用 wget 下载,且要求 16k wav 格式。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本r1.5.0
  1. r1.5.0PaddleSpeech r1.5.0最新正式版2025-03-05 · 2025-03-05 07:11 UTC

    Highlight

    New Features

    • Add AudioTools toolkit support used in DAC (Descript-Audio-Codec) training and inference.
    • Reproduce the losses required for DAC model: MultiScaleSTFTLoss, GANLoss, and SISDRLoss.

    Version Adaptation

    Upgrade and adapt PaddleSpeech from Paddle 2.5.1 to Paddle 3.0.0-beta. Address incompatibility issues caused by the new version upgrade of Paddle, perform adaptation development and regression testing on the models in PaddleSpeech, and ensure the suite operates normally without loss of model functionality or accuracy.

    • Ensure the adaptation of 80+ existing models in the demo and example directories.
    • Ensure the adaptation and accuracy alignment of 10+ core models in the example directory.
    • Support the re-export of 20+ dynamic-to-static models using the PIR + predictor approach and ensure successful inference.

    More Detail

    New Features

    • Add AudioTools toolkit #3900 (@DrRyanHuang)
    • Add FFT convolution layer implementation #3947 (@DrRyanHuang)
    • Implement loss functions required for DAC training #3988 (@cchenhaifeng)
    • Add quantifiers and unit symbols support #3837 (@undefined-ux)
    • Add multiple PIR models #3956, #3982 (@zxcd)
    • Add chunk configuration for tal_cs #3936 (@zxcd)

    Version Adaptation

    • Enhance NumPy compatibility #3907 (@GreatV)
    • Fix Whisper model support under Paddle 3.0 #3880 (@yinfan98)
    • Remove dependency on paddlepaddle-gpu #3898 (@Liyulingyue)
    • Support new inference interface #3927 (@zxcd)
    • Modify inference to be compatible with Paddle 3.0 #3963 (@megemini)
    • Fix cls static model infer error #3856 (@zxcd)
    • Remove parser.add_argument #3878 (@Liyulingyue)
    • Add strtobool implementation #3877 (@Liyulingyue)
    • Fix view to shape for wav2vec2 #3904 (@Liyulingyue)
    • Fix 0D tensor to 1D issue #3913 (@megemini)
    • Fix type promotion issues #3817, #3883, #3944, #3943 (@megemini @GreatV)
    • Fix shape error in layer normalization #3884 (@Liyulingyue)
    • Resolve scipy import error #3874 (@GreatV)
    • Fix vits type promotion and 0D #3920 (@Liyulingyue)
    • Fix fastspeech2 0d issue #3951 (@megemini)
    • Fix emb initialization #3962 (@megemini)
    • Replace view with reshape #3887, #3939 (@GreatV, @megemini)
    • Fix max between int and value #3903 (@megemini)
    • Fix duplicated argument #3934 (@megemini)
    • Fix asr5 test.sh script path error #3941 (@megemini)
    • Fix vctk spk_emb dimension issue #3916 (@megemini)
    • Fix type promotion for aishell3/vctk vc0/ernie #3928 (@Liyulingyue)
    • Use numpy for transpose #3933 (@megemini)
    • Fix shape issues in opencopop svs1 #3912 (@enkilee)
    • Fix deepspeech2online export issue #3935 (@Liyulingyue)
    • Adapt whisper list for paddle 3.0 #4018 (@Liyulingyue)

    Installation Adaptation

    • Optimize Python version compatibility #3965, #3967, #3969, #3970, #3972 (@Liyulingyue)
    • Add hints for installing with -e option #3979 (@Liyulingyue)
    • Move audiotools requirements to setup.py #3999 (@zxcd)
    • Lower installation requirements #3985 by @Liyulingyue
    • Remove paddleaudio from PaddleSpeech #3986 by @zxcd
    • Update install_openblas.sh #3876 (@GreatV)
    • Update setup.py #3964, #3995 (@Liyulingyue)
    • Adapt for librosa #3989 (@Liyulingyue)
    • Lower installation requirements #3985 (@Liyulingyue)
    • Remove paddleaudio from PaddleSpeech #3986 (@zxcd)
    • Define PythonDetermine in setup.py #3975 (@Liyulingyue)
    • Add paddle3.0 beta1 cpu docker #4000 (@Liyulingyue)

    Hardware Support

    • Add GCU Backend support #3875 (@wanx7130)
    • SpeedySpeech code adaptation for NPU #3804 (@warrentdrew)
    • SpeedySpeech code adaptation for MLU #3828 (@warrentdrew)

    Docs

    • Add Squeezeformer information to README #3860 (@zxcd)
    • Add README documentation for TIMIT/ASR1 #3930 (@enkilee)
    • Fix multiple examples and demos #3830, #3872 (@zxcd @Liyulingyue)
    • Fix tess readme #3882 (@megemini)
    • Update README.md #3890 (@Liyulingyue)
    • Fix Example/tiny documentation errors #3892 (@Liyulingyue)
    • Update tal_cs readme #3911 (@megemini)
  2. r1.4.2PaddleSpeech r1.4.22024-06-27 · 2024-06-27 03:45 UTC
    查看更新说明

    S2T

    • Add WavLM ASR-en, WavLM fine-tuning for ASR on LibriSpeech. #3242 by @jiamingkong
    • Add HuBERT ASR-en, HuBERT fine-tuning for ASR on LibriSpeech. #3088 by @Zth9730
    • Add Squeezeformer model. #2755 by @yeyupiaoling
    • Add AMP for U2 conformer. #3167 by @zxcd
    • Mv dataset into paddlespeech.dataset. #3183 #3189 by @zh794390558
    • Fix example/aishell local/train.sh if condition bug. #3146 by @lemondy
    • Fix cli args to config. #3194 by @zh794390558
    • Fix scaler save, load, unscale_ blow, grad_clip. by @zxcd

    T2S

    • Add SVS(Singing Voice Synthesis) examples with Opencpop dataset, including DiffSinger、PWGAN (#3031 by @lym0302) and HiFiGAN (#3038 by @lym0302), the effect is continuously optimized.
    • Add SVS frontend. #3062 by @lym0302
    • Add TTS iSTFTNet (#3006 by @longRookie), TTS JETS (#3109 by @ljhzxc)
    • Starganv2: by @yt605155624
      • Clean starganv2 vc model code and add docstring. #2987
      • Add starganv2 vc trainer. #3143 #3182
      • Add StarGANv2VC preprocess. #3163
      • Fix losses of StarGAN v2 VC. #3184
    • Support for LITE: by @yt605155624
      • Fix elementwise_floordiv's fill_constant. #3075
      • Fix VITS lite infer. #3098
      • Fix vits reduce_sum's input/output dtype. #3028
      • Fix dtype diff of last expand_v2 op of VITS. #3041
      • Fix input dtype of elementwise_mul op from bool to int64. #3054
    • Add XPU support for SpeedySpeech and FastSpeech2. #3502 #3514 by @USTCKAY
    • Fix some preprocess bugs. #3155 by @yt605155624
    • Fix bug of merge_yi function. #3786 by @mattheliu

    Server

    • Add code-switch conformer_talcs support. #3230 by @Gsonovb
    • Add subtitle file (.srt format) generation example. #3123 by @twoDogy
    • Fix: add file read encoding. #3606 by @Coloryr Install & Benchmark
    • Update paddle2onnx to newest install version. #3084 by @yt605155624
    • Update to py3.8, fix librosa==0.8.1 numpy==1.23.5 for paddleaudio. by @zh794390558
    • Fix transformation import error. #3779 by @kk-2000
    • Adapt view behavior change, fix KeyError. #3794 by @zxcd
    • Fix profiler, fix gpu_mem unit, add max_mem_reserved for benchmark. #3323 #3634 #3604 by @mmglove

    Docs

    • Fix some typos. #3178 by @Yulv-git
    • Update svs_music_score.md. #3085 #3070 by @lym0302
    • Update quick_start.md. #3175 #3176 by @46319943
    • Add cli test readme. #3784 by @zxcd
    • Update bug-report-tts.md. #3120 by @yt605155624

    Others

    • Fix 0-d tensor, with the upgrade of paddlepaddle==2.5, the problem of modifying 0-d tensor has been solved. #3214 by zxcd #3334 by @zh794390558
    • Add dtype param for arange API. #3302 by @zxcd
    • Fix develop bug function:view to reshape. #3633 by @luyao-cv
    • Fix progress bar unit. #3177 by @46319943
    • Rm unused dep. #3097 by @lym0302

    Acknowledgements

    Special thanks to @jiamingkong @Zth9730 @yeyupiaoling @zxcd @zh794390558 @lemondy @lym0302 @longRookie @ljhzxc @yt605155624 @USTCKAY @mattheliu @Gsonovb @twoDogy @Coloryr @kk-2000 @mmglove @Yulv-git @46319943 @luyao-cv

    New Contributors

    • @jiamingkong made their first contribution in #3242
    • @yeyupiaoling made their first contribution in #2755
    • @lemondy made their first contribution in #3146
    • @longRookie made their first contribution in #3006
    • @ljhzxc made their first contribution in #3109
    • @USTCKAY made their first contribution in #3502
    • @mattheliu made their first contribution in #3786
    • @Gsonovb made their first contribution in #3230
    • @twoDogy made their first contribution in #3123
    • @Coloryr made their first contribution in #3606
    • @kk-2000 made their first contribution in #3779
    • @Yulv-git made their first contribution in #3178
    • @46319943 made their first contribution in #3175
    • @luyao-cv made their first contribution in #3633

    Full Changelog: https://github.com/PaddlePaddle/PaddleSpeech/compare/r1.4.1...r1.4.2

  3. r1.4.1PaddleSpeech r1.4.12023-04-14 · 2023-04-14 09:36 UTC
    查看更新说明

    Others

  4. r1.4.0PaddleSpeech r1.4.02023-03-15 · 2023-03-15 08:10 UTC
    查看更新说明

    S2T

    T2S

    Server

    Engine

    Audio

  5. r1.3.0PaddleSpeech r1.3.02022-12-14 · 2022-12-14 06:38 UTC
    查看更新说明

    HighLIght

    S2T

    • Support U2/U2++ Conformer dy2static, and U2/U2++ C++ High Performance Streaming ASR Deployment. @zh794390558
    • Add Wav2vec2ASR-en, wav2vec2.0 fine-tuning for ASR on LibriSpeech. @Zth9730
    • Add Whisper CLI and Demos, support multi language recognition and translation. @zxcd
    • Add Wav2vec2 CLI and Demos, support ASR and Feature Extraction. @Zth9730
    • Add whisper. #2640 #2704 by @zxcd
    • Fix gpu training hang. #2478 by @Zth9730
    • Support u2++ based cli and server. #2489 #2510 by @Zth9730
    • Add wav2vec2-en. #2518 #2527 #2637 by @Zth9730
    • Add wav2vec2-zh cli. #2697 by @Zth9730

    T2S

    Audio

    Demo

    New Contributors

    Full Changelog: https://github.com/PaddlePaddle/PaddleSpeech/compare/r1.2.0...r1.3.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    (简体中文|English)


    PaddleSpeech is an open-source toolkit on PaddlePaddle platform for a variety of critical tasks in speech and audio, with the state-of-art and influential models.

    PaddleSpeech won the NAACL2022 Best Demo Award, please check out our paper on Arxiv.

    Speech Recognition
    Speech Translation (English to Chinese)
    Text-to-Speech

    For more synthesized audios, please refer to PaddleSpeech Text-to-Speech samples.

    Punctuation Restoration

    Features

    Via the easy-to-use, efficient, flexible and scalable implementation, our vision is to empower both industrial application and academic research, including training, inference & testing modules, and deployment process. To be more specific, this toolkit features at:

    • 📦 Ease of Use: low barriers to install, CLI, Server, and Streaming Server is available to quick-start your journey.
    • 🏆 Align to the State-of-the-Art: we provide high-speed and ultra-lightweight models, and also cutting-edge technology.
    • 🏆 Streaming ASR and TTS System: we provide production ready streaming asr and streaming tts system.
    • 💯 Rule-based Chinese frontend: our frontend contains Text Normalization and Grapheme-to-Phoneme (G2P, including Polyphone and Tone Sandhi). Moreover, we use self-defined linguistic rules to adapt Chinese context.
    • 📦 Varieties of Functions that Vitalize both Industrial and Academia:
      • 🛎️ Implementation of critical audio tasks: this toolkit contains audio functions like Automatic Speech Recognition, Text-to-Speech Synthesis, Speaker Verification, KeyWord Spotting, Audio Classification, and Speech Translation, etc.
      • 🔬 Integration of mainstream models and datasets: the toolkit implements modules that participate in the whole pipeline of the speech tasks, and uses mainstream datasets like LibriSpeech, LJSpeech, AIShell, CSMSC, etc. See also model list for more details.
      • 🧩 Cascaded models application: as an extension of the typical traditional audio tasks, we combine the workflows of the aforementioned tasks with other fields like Natural language processing (NLP) and Computer Vision (CV).

    Recent Update

    Community

    • Scan the QR code below with your Wechat, you can access to official technical exchange group and get the bonus ( more than 20GB learning materials, such as papers, codes and videos ) and the live link of the lessons. Look forward to your participation.

    Installation

    We strongly recommend our users to install PaddleSpeech in Linux with python>=3.8.

    Dependency Introduction

    • gcc >= 4.8.5
    • paddlepaddle
    • python >= 3.8
    • OS support: Linux(recommend), Windows, Mac OSX

    PaddleSpeech depends on paddlepaddle. For installation, please refer to the official website of paddlepaddle and choose according to your own machine. Here is an example of the cpu version.

    pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
    

    You can also specify the version of paddlepaddle or install the develop version.

    # install 2.4.1 version. Note, 2.4.1 is just an example, please follow the minimum dependency of paddlepaddle for your selection
    pip install paddlepaddle==2.4.1 -i https://mirror.baidu.com/pypi/simple
    # install develop version
    pip install paddlepaddle==0.0.0 -f https://www.paddlepaddle.org.cn/whl/linux/cpu-mkl/develop.html
    

    There are two quick installation methods for PaddleSpeech, one is pip installation, and the other is source code compilation (recommended).

    pip install

    pip install pytest-runner
    pip install paddlespeech
    

    source code compilation

    git clone https://github.com/PaddlePaddle/PaddleSpeech.git
    cd PaddleSpeech
    pip install pytest-runner
    pip install .
    # If you need to install in editable mode, you need to use --use-pep517. The command is as follows:
    # pip install -e . --use-pep517
    

    For more installation problems, such as conda environment, librosa-dependent, gcc problems, kaldi installation, etc., you can refer to this installation document. If you encounter problems during installation, you can leave a message on #2150 and find related problems

    Quick Start

    Developers can have a try of our models with PaddleSpeech Command Line or Python. Change --input to test your own audio/text and support 16k wav format audio.

    You can also quickly experience it in AI Studio 👉🏻 PaddleSpeech API Demo

    Test audio sample download

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

    Automatic Speech Recognition

    command line experience

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

    Python API experience

    >>> from paddlespeech.cli.asr.infer import ASRExecutor
    >>> asr = ASRExecutor()
    >>> result = asr(audio_file="zh.wav")
    >>> print(result)
    我认为跑步最重要的就是给我带来了身体健康
    

    Text-to-Speech

    Output 24k sample rate wav format audio

    command line experience

    paddlespeech tts --input "你好,欢迎使用百度飞桨深度学习框架!" --output output.wav
    

    Python API experience

    >>> from paddlespeech.cli.tts.infer import TTSExecutor
    >>> tts = TTSExecutor()
    >>> tts(text="今天天气十分不错。", output="output.wav")
    

    Audio Classification

    Sound classification model based on 527 categories of AudioSet dataset

    command line experience

    paddlespeech cls --input zh.wav
    

    Python API experience

    >>> from paddlespeech.cli.cls.infer import CLSExecutor
    >>> cls = CLSExecutor()
    >>> result = cls(audio_file="zh.wav")
    >>> print(result)
    Speech 0.9027186632156372
    

    Voiceprint Extraction

    command line experience

    paddlespeech vector --task spk --input zh.wav
    

    Python API experience

    >>> from paddlespeech.cli.vector import VectorExecutor
    >>> vec = VectorExecutor()
    >>> result = vec(audio_file="zh.wav")
    >>> print(result) # 187维向量
    [ -0.19083306   9.474295   -14.122263    -2.0916545    0.04848729
       4.9295826    1.4780062    0.3733844   10.695862     3.2697146
      -4.48199     -0.6617882   -9.170393   -11.1568775   -1.2358263 ...]
    

    Punctuation Restoration

    command line experience

    paddlespeech text --task punc --input 今天的天气真不错啊你下午有空吗我想约你一起去吃饭
    

    Python API experience

    >>> from paddlespeech.cli.text.infer import TextExecutor
    >>> text_punc = TextExecutor()
    >>> result = text_punc(text="今天的天气真不错啊你下午有空吗我想约你一起去吃饭")
    今天的天气真不错啊!你下午有空吗?我想约你一起去吃饭。
    

    Speech Translation

    Use pre-compiled kaldi related tools, only support experience in Ubuntu system

    command line experience

    paddlespeech st --input en.wav
    

    Python API experience

    >>> from paddlespeech.cli.st.infer import STExecutor
    >>> st = STExecutor()
    >>> result = st(audio_file="en.wav")
    ['我 在 这栋 建筑 的 古老 门上 敲门 。']
    

    Quick Start Server

    Developers can have a try of our speech server with PaddleSpeech Server Command Line.

    You can try it quickly in AI Studio (recommend): SpeechServer

    Start server

    paddlespeech_server start --config_file ./demos/speech_server/conf/application.yaml
    

    Access Speech Recognition Services

    paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input input_16k.wav
    

    Access Text to Speech Services

    paddlespeech_client tts --server_ip 127.0.0.1 --port 8090 --input "您好,欢迎使用百度飞桨语音合成服务。" --output output.wav
    

    Access Audio Classification Services

    paddlespeech_client cls --server_ip 127.0.0.1 --port 8090 --input input.wav
    

    For more information about server command lines, please see: speech server demos

    Quick Start Streaming Server

    Developers can have a try of streaming asr and streaming tts server.

    Start Streaming Speech Recognition Server

    paddlespeech_server start --config_file ./demos/streaming_asr_server/conf/application.yaml
    

    Access Streaming Speech Recognition Services

    paddlespeech_client asr_online --server_ip 127.0.0.1 --port 8090 --input input_16k.wav
    

    Start Streaming Text to Speech Server

    paddlespeech_server start --config_file ./demos/streaming_tts_server/conf/tts_online_application.yaml
    

    Access Streaming Text to Speech Services

    paddlespeech_client tts_online --server_ip 127.0.0.1 --port 8092 --protocol http --input "您好,欢迎使用百度飞桨语音合成服务。" --output output.wav
    

    For more information please see: streaming asr and streaming tts

    Model List

    PaddleSpeech supports a series of most popular models. They are summarized in released models and attached with available pretrained models.

    Speech-to-Text contains Acoustic Model, Language Model, and Speech Translation, with the following details:

    Text-to-Speech in PaddleSpeech mainly contains three modules: Text Frontend, Acoustic Model and Vocoder. Acoustic Model and Vocoder models are listed as follow:

    Audio Classification

    Keyword Spotting

    Speaker Verification

    Speaker Diarization

    Punctuation Restoration

    Documents

    Normally, Speech SoTA, Audio SoTA and Music SoTA give you an overview of the hot academic topics in the related area. To focus on the tasks in PaddleSpeech, you will find the following guidelines are helpful to grasp the core ideas.

    The Text-to-Speech module is originally called Parakeet, and now merged with this repository. If you are interested in academic research about this task, please see TTS research overview. Also, this document is a good guideline for the pipeline components.

    ⭐ Examples

    • PaddleBoBo: Use PaddleSpeech TTS to generate virtual human voice.

    Citation

    To cite PaddleSpeech for research, please use the following format.

    @inproceedings{zhang2022paddlespeech,
        title = {PaddleSpeech: An Easy-to-Use All-in-One Speech Toolkit},
        author = {Hui Zhang, Tian Yuan, Junkun Chen, Xintong Li, Renjie Zheng, Yuxin Huang, Xiaojie Chen, Enlei Gong, Zeyu Chen, Xiaoguang Hu, dianhai yu, Yanjun Ma, Liang Huang},
        booktitle = {Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Demonstrations},
        year = {2022},
        publisher = {Association for Computational Linguistics},
    }
    
    @InProceedings{pmlr-v162-bai22d,
      title = {{A}$^3${T}: Alignment-Aware Acoustic and Text Pretraining for Speech Synthesis and Editing},
      author = {Bai, He and Zheng, Renjie and Chen, Junkun and Ma, Mingbo and Li, Xintong and Huang, Liang},
      booktitle = {Proceedings of the 39th International Conference on Machine Learning},
      pages = {1399--1411},
      year = {2022},
      volume = {162},
      series = {Proceedings of Machine Learning Research},
      month = {17--23 Jul},
      publisher = {PMLR},
      pdf = {https://proceedings.mlr.press/v162/bai22d/bai22d.pdf},
      url = {https://proceedings.mlr.press/v162/bai22d.html},
    }
    
    @inproceedings{zheng2021fused,
      title={Fused acoustic and text encoding for multimodal bilingual pretraining and speech translation},
      author={Zheng, Renjie and Chen, Junkun and Ma, Mingbo and Huang, Liang},
      booktitle={International Conference on Machine Learning},
      pages={12736--12746},
      year={2021},
      organization={PMLR}
    }
    

    Contribute to PaddleSpeech

    You are warmly welcome to submit questions in discussions and bug reports in issues! Also, we highly appreciate if you are willing to contribute to this project!

    Contributors

    Acknowledgement

    License

    PaddleSpeech is provided under the Apache-2.0 License.

    Stargazers over time

    Stargazers over time