需自行从 releases/tag/models 下载预训练模型,仓库不含模型文件;安装与构建步骤不在 README 中,需查阅在线文档;README 未说明默认端口等运行参数
sherpa-ncnn
k2-fsaApache-2.0长期未更新基于新一代 Kaldi 和 ncnn 的离线实时语音识别与语音活动检测引擎,无需联网即可在手机、嵌入式板卡和桌面端跑起来。
Real-time speech recognition and voice activity detection (VAD) using next-gen Kaldi with ncnn without Internet connection. Support iOS, Android, Linux, macOS, Windows, Raspberry Pi, VisionFive2, LicheePi4A etc.
README 未给出具体安装命令,需参考文档 https://k2-fsa.github.io/sherpa/ncnn/index.html 从源码编译README 未说明显存或具体 GPU 型号要求;支持 x86、x86_64、arm32、arm64、riscv64 架构,可运行于 Linux、macOS、Windows、Android、iOS、NodeJS、WebAssembly、树莓派、RV1126、LicheePi4A、VisionFive 2、旭日X3派等平台。
基于新一代 Kaldi 与 ncnn 的离线实时语音识别、语音合成与 VAD 工具,可跑在手机和嵌入式板子上
基于新一代 Kaldi 和 ncnn 的离线实时语音识别与语音活动检测引擎,无需联网即可在手机、嵌入式板卡和桌面端跑起来。
核心能力
- 用 ncnn 推理,不依赖 PyTorch 等框架
- 支持流式语音识别、TTS 与 VAD 三类功能
- 提供 C/C++/Python/Go/C#/Kotlin/JS/Swift 接口
- 可静态编译,产物只依赖系统库
- 覆盖 Android、iOS、WebAssembly、树莓派、RISC-V 等平台
容易踩的坑
- v2.1.15最新正式版2025-09-16 · 2025-09-16 08:09 UTC
What's Changed
- Update README to include tts by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/412
- Update ncnn to fix #330 by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/414
- Export sense voice to sherpa-ncnn by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/416
- Add C++ runtime for sense-voice ASR models by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/418
- Add Python API for sense-voice ASR models by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/419
- Fix building for Windows by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/421
- Add C++ example for VAD + microphone by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/422
- Add C++ real-time speech recognition example for SenseVoice + VAD. by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/423
- Release v2.1.15 by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/424
Full Changelog: https://github.com/k2-fsa/sherpa-ncnn/compare/v2.1.14...v2.1.15
- asr-models2025-09-13 · 2025-09-13 10:48 UTC
这个版本没有写更新说明。
- v2.1.142025-09-05 · 2025-09-05 15:43 UTC
查看更新说明
What's Changed
- Fix CI by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/405
- Fix releasing nuget packages by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/406
- Support multi-speaker piper tts models. by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/407
- Add piper tts export scripts from nihui by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/408
- Export more Piper TTS models to sherpa-ncnn by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/409
- Add Python API for TTS by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/410
- Release v2.1.14 by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/411
Full Changelog: https://github.com/k2-fsa/sherpa-ncnn/compare/v2.1.13...v2.1.14
- v2.1.132025-09-03 · 2025-09-03 15:42 UTC
查看更新说明
What's Changed
- Fix building npm packages by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/380
- nodejs hotwords example by @chen-junqiao in https://github.com/k2-fsa/sherpa-ncnn/pull/381
- Add hotwords-decode-file.js example by @chen-junqiao in https://github.com/k2-fsa/sherpa-ncnn/pull/382
- Fix nodejs by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/384
- Update nodejs microphone example to use mic by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/385
- Add parse options from Kaldi. by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/387
- Update ncnn to tencent/ncnn's latest master by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/388
- Adapt CMake Version by @naivetoby in https://github.com/k2-fsa/sherpa-ncnn/pull/389
- Update cmake deps by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/396
- Add parse options from Kaldi by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/397
- Add piper tts by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/399
- fix(windows): support GB2312 input text for offline TTS by @HeiSir2014 in https://github.com/k2-fsa/sherpa-ncnn/pull/400
- Update CI to include tts tests. by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/401
- Refactor building Python wheels. by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/402
- Publish Python packages sherpa-ncnn-bin and sherpa-ncnn-core by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/403
- Release v2.1.13 by @csukuangfj in https://github.com/k2-fsa/sherpa-ncnn/pull/404
New Contributors
- @naivetoby made their first contribution in https://github.com/k2-fsa/sherpa-ncnn/pull/389
- @HeiSir2014 made their first contribution in https://github.com/k2-fsa/sherpa-ncnn/pull/400
Full Changelog: https://github.com/k2-fsa/sherpa-ncnn/compare/v2.1.11...v2.1.13
- tts-models2025-08-15 · 2025-08-15 10:08 UTC
这个版本没有写更新说明。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Supported functions
| Real-time Speech recognition | Speech synthesis | Voice activity detection |
|---|---|---|
| ✔️ | ✔️ | ✔️ |
Supported platforms
| Architecture | Android | iOS | Windows | macOS | linux |
|---|---|---|---|---|---|
| x64 | ✔️ | ✔️ | ✔️ | ✔️ | |
| x86 | ✔️ | ✔️ | |||
| arm64 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| arm32 | ✔️ | ✔️ | |||
| riscv64 | ✔️ |
Supported programming languages
| 1. C++ | 2. C | 3. Python | 4. JavaScript |
|---|---|---|---|
| ✔️ | ✔️ | ✔️ | ✔️ |
| 5. Go | 6. C# | 7. Kotlin | 8. Swift |
|---|---|---|---|
| ✔️ | ✔️ | ✔️ | ✔️ |
It also supports WebAssembly.
Introduction
This repository supports running the following functions locally
- Streaming speech-to-text (i.e., real-time speech recognition)
- Text to speech (e.g., vits models from piper)
- VAD (e.g., silero-vad)
on the following platforms and operating systems:
- x86,
x86_64, 32-bit ARM, 64-bit ARM (arm64, aarch64), RISC-V (riscv64) - Linux, macOS, Windows, openKylin
- Android, WearOS
- iOS
- NodeJS
- WebAssembly
- Raspberry Pi
- RV1126
- LicheePi4A
- VisionFive 2
- 旭日X3派
- etc
with the following APIs
- C++, C, Python, Go,
C# - Kotlin
- JavaScript
- Swift
We support all platforms that ncnn supports.
Everything can be compiled from source with static link. The generated executable depends only on system libraries.
HINT: It does not depend on PyTorch or any other inference frameworks other than ncnn.
Please see the documentation https://k2-fsa.github.io/sherpa/ncnn/index.html for installation and usages, e.g.,
- How to build an Android app
- How to download and use pre-trained models
We provide a few YouTube videos for demonstration about real-time speech recognition
with sherpa-ncnn using a microphone:
-
Multilingual (Chinese + English) with endpointing Python demo : https://www.bilibili.com/video/BV1eK411y788/
-
Android demos
-
Multilingual (Chinese + English) Android demo 1: https://www.bilibili.com/video/BV1Ge411A7XS
-
Multilingual (Chinese + English) Android demo 2: https://www.bilibili.com/video/BV1eK411y788/
-
Chinese (with background noise)Android demo : https://www.bilibili.com/video/BV1GR4y167fx -
ChineseAndroid demo : https://www.bilibili.com/video/BV1744y1Z76H -
Chinese poem with background musicAndroid demo : https://www.bilibili.com/video/BV1vR4y1k7eo
Links for pre-built Android APKs
| Description | URL |
|---|---|
| Streaming speech recognition | Address |
Links for pre-trained models
https://github.com/k2-fsa/sherpa-ncnn/releases/tag/models
Useful links
- Documentation: https://k2-fsa.github.io/sherpa/ncnn/
- Bilibili 演示视频: https://search.bilibili.com/all?keyword=%E6%96%B0%E4%B8%80%E4%BB%A3Kaldi
How to reach us
Please see https://k2-fsa.github.io/sherpa/social-groups.html for 新一代 Kaldi 微信交流群 and QQ 交流群.