Commit Graph
186 Commits
Author SHA1 Message Date
Hassan Kazi 1d6eba7b93 Feed the VAD one window at a time in vad-microphone.py and vad-alsa.py (#4050)
Both examples passed each 0.1 s read straight to accept_waveform(), which expects
window-sized input. Buffer the reads and feed window_size samples per call, as the
other VAD examples do.
2026-10-21 10:02:04 +08:00
Fangjun Kuang a83acee682 Fix typos in the project. (#4073) 2026-10-21 09:57:49 +08:00
Mohammad Hijjawi 1bca6ae4e4 Fix malformed SRT timestamps in generate-subtitles.py (#4009)
The timestamps were built as str(timedelta(seconds=t))[:-3]. That only
works when t has a fractional part: for a whole number of seconds
str(timedelta) has no ".ffffff" suffix, so the slice cuts off the
seconds instead, e.g. a segment starting at 0 s was written as
"0:00 --> 0:00:01,500". Hours were also written with a single digit,
while SRT expects HH:MM:SS,mmm.

Format the timestamps explicitly as HH:MM:SS,mmm for both the .srt
and the .txt output.
2026-10-20 17:36:51 +08:00
Fangjun Kuang 0b3647632f Remove espeak-ng and piper-phonemize from sherpa-onnx (#4055)
Fixes #3731

espeak-ng and piper-phonemize are no longer built into sherpa-onnx.

Text frontends are now:

- **lexicon** — built in, no extra dependency
- **phonemize** — phonemize outside sherpa-onnx (e.g. [piper-phonemize](https://github.com/csukuangfj/piper-phonemize)) and pass the result in. That library is GPL, so it stays optional: sherpa-onnx is GPL-free after this PR.

## API

- `SherpaOnnxGenerationConfig` gains `phoneme_codepoints` and `tokens` (mutually exclusive alternatives to `text`)
- `data_dir` on the TTS model configs is deprecated and ignored; the ABI slot is kept
- all bindings updated: C/C++, Python, Java, Kotlin, Go, Rust, C#, Swift, Pascal, Dart/Flutter, node-addon, WASM, HarmonyOS
2026-10-20 11:09:04 +08:00
Jasper fa29eb91c8 Pad 1s of silence on endpoint for streaming paraformer in Python examples (mirror C++ behavior, #1373) (#4052) 2026-10-15 13:52:34 +08:00
Fangjun Kuang 1ca55ff076 Add subtitle generation Python API example for Doubao ASR. (#4027)
* Add subtitle generation Python API example for Doubao ASR.

generate-subtitles-doubao.py uses silero-vad/ten-vad for segmentation and
the Doubao bigmodel recording-file recognition API for ASR. Audio segments
are sent as base64 encoded wav data, so no public URL is needed. Results
are written to <input>.srt and <input>.txt.

Also for generate-subtitles.py:

 - Add --max-duration-seconds to process only the first N seconds of the
   input file
 - Refuse to run if <input>.srt or <input>.txt already exists
2026-10-09 13:55:48 +08:00
Fangjun Kuang e20ed70c35 Add subtitle generation Python api example for Qwen3 ASR (#3972) 2026-09-21 16:36:27 +08:00
Nathan Roll 46e1ab7c99 Support NeMo transducers in offline Python examples (#3952)
See https://huggingface.co/oruk/orukeet
2026-09-14 09:19:20 +08:00
Julian Pscheid 3e40933895 Expose the pyannote window shift ratio in the C API and language bindings (#3870) 2026-08-13 19:26:44 +08:00
danielr-ceva 42a2b681ba Add support for latest DPDFNet models and offline attenuation limit (#3824) 2026-08-10 20:37:58 +08:00
shresth rana 2744aa2cd0 Fix non_streaming_server.py crash when using modified_beam_search (#3819)
check_args() referenced args.num_active_paths, but this script defines the
flag as --max-active-paths (and consumes args.max_active_paths), so
--decoding-method modified_beam_search crashed with AttributeError at startup.
2026-07-29 11:35:02 +08:00
Fangjun Kuang 75e1fc31e7 Build Python wheels for Windows arm64 (#3812) 2026-07-28 17:05:19 +08:00
Fangjun Kuang ccdaef8bba Add API to get onnxruntime version. (#3810) 2026-07-28 14:02:43 +08:00
matiaslin a2b7ab97e7 Add offline CATT diacritization (encoder only) (#3647) 2026-06-10 14:16:57 +08:00
Fangjun Kuang 6abe9990be Fix generating subtitles for funasr nano (#3659) 2026-06-04 18:33:21 +08:00
Fangjun Kuang a703cf6560 Improve C/C++ API documentation, examples, and CI (#3626) 2026-05-20 12:10:05 +08:00
Wasser1462 e2557bbfe1 Support Supertonic 3 TTS (#3605) 2026-05-13 09:21:45 +08:00
kapitalismho 14fcde5efb Add per-stream language hint for Qwen3-ASR (and tighten scaffold cleanup) (#3472) 2026-04-07 09:21:17 +08:00
Fangjun Kuang 6ee89f0242 Add C API and CXX API for Cohere transcribe models (#3457) 2026-04-02 17:01:25 +08:00
Fangjun Kuang 6fb6f7d693 Add C++ runtime and Python API for Cohere Transcribe (#3456)
This pull request adds support for the Cohere Transcribe model, implementing the necessary C++ classes, greedy search decoding, and Python bindings.
2026-04-02 16:00:23 +08:00
Wasser1462 36a29236f9 Add hotwords support for Qwen3-ASR (#3434) 2026-04-01 15:35:34 +08:00
Fangjun Kuang 81df805650 Update tests for Qwen3 ASR (#3410) 2026-03-25 19:26:56 +08:00
Wasser1462 93a0e67d52 Add Qwen3-ASR support (#3399)
This pull request expands the capabilities of sherpa-onnx by integrating offline Qwen3-ASR models. It provides the necessary infrastructure, including model loading, configuration, and a specialized tokenizer, to enable accurate speech recognition for these models. The addition of C, C++, and Python examples ensures ease of adoption for developers looking to leverage Qwen3-ASR in their applications.
2026-03-25 17:03:27 +08:00
Fangjun Kuang b7f083d139 Update Python subtitle script to support FireRedASR CTC and FunASR Nano. (#3400) 2026-03-24 16:41:51 +08:00
Fangjun Kuang 926152b958 Refactor VITS to use the new Generate API (#3365) 2026-03-19 20:34:52 +08:00
Fangjun Kuang 8a45871027 Add Python API examples for ZipVoice TTS (#3335)
This pull request enhances the Python API examples for Text-to-Speech by introducing dedicated scripts for ZipVoice TTS. It provides users with clear, runnable demonstrations of both standard zero-shot synthesis and real-time audio playback during generation. The changes also streamline the example structure by removing an older, more generic script and deprecating an outdated API function, promoting the use of a more modern GenerationConfig approach.
2026-03-17 18:00:33 +08:00
Fangjun Kuang 45fb4f5f0b Add online speech denoiser for GTCRN and examples (#3324)
This PR adds online (streaming) speech denoising support for GTCRN alongside existing DPDFNet support, and updates multi-language bindings/examples to expose and validate the new capability.
2026-03-17 11:56:56 +08:00
danielr-ceva 807c496f4c Add DPDFNet speech denoiser support for offline and streaming (#3276)
This pull request enhances the speech processing capabilities of sherpa-onnx by integrating DPDFNet models for speech enhancement. It introduces both offline and streaming denoising functionalities, supporting various model profiles and sample rates. This expansion provides users with more advanced and flexible options for improving audio quality in diverse applications, from real-time communication to post-processing of recordings.
2026-03-16 14:53:12 +08:00
Fangjun Kuang abaf2860bb Fix typos in the project (#3293) 2026-03-12 11:10:55 +08:00
Fangjun Kuang 33554f742c Add Python API examples for Supertonic TTS (#3264) 2026-03-06 15:26:02 +08:00
Fangjun Kuang 3ff34bb8d6 Update Python APIs for Moonshine v2 models (#3235) 2026-02-27 17:00:37 +08:00
Fangjun Kuang cbe547a49c Support FireRedASR CTC models (#3221)
This PR adds support for FireRedASR CTC models to the sherpa-onnx offline speech recognition system. The implementation includes new model configuration classes, integration into the existing CTC recognition pipeline, and comprehensive testing infrastructure.
2026-02-26 15:38:23 +08:00
Joe Cheng 7be9a38e27 Whisper timestamps (#2945)
This pull request significantly enhances the Whisper integration by introducing comprehensive timestamping capabilities. It provides both fine-grained token-level timestamps, derived from cross-attention weights using Dynamic Time Warping, and broader segment-level timestamps, based on Whisper's native timestamp tokens. This allows for more detailed temporal alignment of transcribed text with audio, which is crucial for applications like subtitle generation and improving the handling of long audio inputs. The changes span model export utilities, core C++ logic, and Python API bindings to fully support these new features.
2026-02-05 13:10:37 +08:00
Edison dos Santos 67b53a018c feat: add support for Meta Omnilingual ASR v2 models (#3138)
This pull request integrates support for the latest Meta Omnilingual ASR v2 models, enhancing the project's multilingual speech recognition capabilities without requiring modifications to the core C++ codebase. It introduces a dedicated Python example to facilitate usage and demonstrates the model's performance and compatibility.
2026-02-05 12:34:19 +08:00
Wasser1462 9799efcf06 Add hotword support for FunASR-Nano (#3122)
This pull request significantly enhances the FunASR-nano model integration by introducing advanced control over the transcription process. Users can now leverage hotwords to guide recognition, specify the target language, and manage Inverse Text Normalization (ITN) settings. These capabilities are seamlessly exposed through comprehensive API updates across Python, Java, Kotlin, and Swift. Additionally, the underlying C++ implementation benefits from performance optimizations via CPU IoBinding and pre-allocated buffers, alongside more informative error messages and debugging logs, contributing to a more robust and user-friendly experience.
2026-02-04 18:05:38 +08:00
Fangjun Kuang db0d94a500 Add CI for PocketTTS. (#3090) 2026-01-27 12:10:05 +08:00
Fangjun Kuang d84be82459 Limit text length for PocketTTS. (#3089)
This pull request significantly enhances the PocketTTS system's ability to process long input texts. By introducing a sophisticated text segmentation and chunking mechanism, the system can now reliably handle extensive content, breaking it down into smaller, more manageable units for synthesis. This refactoring improves the overall stability and user experience when generating speech from lengthy passages, as demonstrated by the updated example script.
2026-01-27 11:39:39 +08:00
Fangjun Kuang 960916075e Add Python API examples for PocketTTS (#3088) 2026-01-27 10:48:30 +08:00
Fangjun Kuang f75cb392e1 Support BPE tokenizer (#3078) 2026-01-26 10:34:49 +08:00
Wasser1462 b82d9c6aff FunASR-nano: switch to unified KV-cache LLM (#2995)
This PR updates FunASR-nano inference from the prefill+decode dual-model pipeline to a single unified KV-cache model.

## Summary

Previously, FunASR-nano required two separate ONNX models:
- `llm_prefill.onnx`
- `llm_decode.onnx`

This PR switches to a single model:
- `llm.onnx`

The new pipeline uses a static KV cache + KV-delta incremental update mechanism, and relies on `cache_position` to differentiate prefill vs. decode steps. This significantly simplifies model/session management and reduces deployment complexity.

## Key changes

- **Single LLM session / single model file**: `llm.onnx` replaces `llm_prefill.onnx` + `llm_decode.onnx`.

- **Unified KV-cache implementation**:
  - static KV cache layout
  - KV-delta update for decode
  - `cache_position` distinguishes prefill vs. decode behavior

- **Config changes (breaking)**:
  - `funasr_nano.llm_prefill` and `funasr_nano.llm_decode` are deprecated/removed
  - use only `funasr_nano.llm`

- **Not backward compatible**:
  - users must re-export models in KV-delta/unified-KV format

- **Trade-off**: slightly slower, but lower VRAM duplication
2026-01-07 10:41:53 +08:00
Wasser1462 4ea060ab49 Add funASR-Nano with LLM support (#2936) 2025-12-30 12:04:29 +08:00
Fangjun Kuang 1f5f9633cc Add C++ runtime and Python API for Google MedASR models (#2935)
This pull request significantly enhances sherpa-onnx by integrating comprehensive support for Google MedASR CTC models. The changes encompass the foundational C++ model implementation, a streamlined Python API for ease of use, and specialized audio feature processing and text post-processing logic to ensure accurate medical speech recognition. This integration also includes updates to the build system and continuous integration tests, alongside a practical Python example, making MedASR models readily available and verifiable within the framework.
2025-12-25 17:25:56 +08:00
Fangjun Kuang a6a36e8cef Use a shorter name for Zipvoice models. (#2894) 2025-12-11 20:30:19 +08:00
Fangjun Kuang 1e4ac57888 Fix building errors (#2893)
This pull request addresses and resolves building errors by refactoring the OfflineTtsZipVoiceModelConfig across various language bindings. The core change involves renaming the pinyinDict parameter to lexicon to standardize terminology and improve clarity in text-to-speech configurations. Additionally, the Python example script for offline zero-shot TTS has been updated to align with these changes, including new model paths and example content, ensuring the examples remain functional and up-to-date.
2025-12-11 19:15:53 +08:00
Fangjun Kuang 1a48531bbd Add simulate streaming ASR Python example for Paraformer (#2839) 2025-12-01 11:54:11 +08:00
Fangjun Kuang 36ef8d1fbc Add C++ and Python API for Omnilingual ASR models. (#2772)
This PR adds C++ and Python API support for Omnilingual ASR models with CTC decoding, enabling speech recognition across 1600+ languages using models from Facebook Research's omnilingual-asr project.

Key changes:

- Implements OfflineOmnilingualAsrCtcModel class with feature normalization and model inference
- Adds Python bindings through from_omnilingual_asr_ctc() method on OfflineRecognizer
- Integrates omnilingual models into existing CTC recognition pipeline with special handling for input shapes and frame shifts
2025-11-13 12:25:30 +08:00
Fangjun Kuang 8568fc4e5d Remove cppjieba (#2664)
This PR removes the cppjieba dependency from the sherpa-onnx project by replacing its usage with character-based text processing. The main purpose is to simplify the codebase by eliminating the need for external jieba dictionary files and the cppjieba library.

- Replaces jieba-based word segmentation with UTF-8 character-level tokenization
- Removes all references to dict_dir and dictDir parameters across APIs
- Adds a new CharacterLexicon class to replace JiebaLexicon
2025-10-10 10:54:32 +08:00
Fangjun Kuang 68194c718c Add Parakeet TDT model for generating subtitles (#2649) 2025-10-07 13:39:11 +08:00
Fangjun Kuang 858b5052a2 Add C++ and Python support for T-one streaming Russian ASR models (#2575)
This PR adds support for T-one streaming Russian ASR models in both C++ and Python APIs. The T-one model is a CTC-based Russian speech recognition model with specific characteristics including float16 state handling, 300ms frame lengths, and 8kHz sampling rate.

- Added new OnlineToneCtcModel implementation with specialized processing for T-one models
- Integrated T-one support into the existing CTC model pipeline and Python bindings
- Added Python example and test scripts for the new functionality
2025-09-09 12:07:34 +08:00
Wei Kangandyaozengwei c149696cb3 Add Zipvoice (#2487)
Co-authored-by: yaozengwei <yaozengwei@outlook.com>
2025-08-27 19:50:00 +08:00