Fixes#3635
It is for v2.0.0 and breaks the ABI.
CircularBuffer::head_ and tail_ are absolute sample counters that grow
forever. As int32_t they overflow after 2^31 samples (~37 h at 16 kHz);
tail_ % capacity then goes negative and std::copy() writes to an invalid
iterator, crashing long-running VAD streams.
Widen every absolute stream position to int64_t. Counts and capacities
(Push/Pop/Get's n, Size(), capacity) stay int32_t — they are bounded by
buffer memory, not stream duration.
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
This pull request introduces support for the Cohere Transcribe model across the Java and Kotlin APIs. Key changes include the addition of the OfflineCohereTranscribeModelConfig class, updated JNI bindings to handle the new configuration, and new example scripts and source files for both languages.
This pull request expands the capabilities of the sherpa-onnx project by integrating the Qwen3 ASR model. It provides new Java and Kotlin APIs, complete with example usage, allowing developers to easily incorporate offline Qwen3 ASR into their applications. The changes include necessary configuration structures, build script updates, and JNI bindings to ensure seamless functionality across platforms.
This pull request streamlines the MatchaTTS API by introducing a consolidated GenerationConfig object for text-to-speech generation parameters. This change affects examples across various programming languages, ensuring a more consistent and extensible interface for controlling speech synthesis attributes like speaker, speed, and silence. The refactoring simplifies future enhancements and reduces parameter sprawl in API calls.
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.
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.
This pull request enhances the Text-to-Speech capabilities by integrating the Supertonic TTS model into the existing Java and Kotlin APIs. It provides developers with new tools and clear examples to generate speech from text using this model, expanding the range of available TTS options and simplifying their adoption within Java and Kotlin projects.
Adds Android-side configuration and packaging support for Moonshine v2 (merged decoder) models so Kotlin/JNI and Java consumers can use the new model layout and ship additional language variants.
Changes:
- Extend Moonshine offline model config to include a v2 mergedDecoder model path and wire it through JNI.
- Add Moonshine v2 quantized model presets (idx 51–60) for multiple languages in the Kotlin offline model selector.
- Update Moonshine v2 export script + APK model list + GitHub Actions workflow to include new model variants and streamline publishing.
Added offline FireRedASR CTC model support with runnable examples and demos across all language bindings (C/C++, Dart, .NET, Flutter, Go, Java, Kotlin, Node.js, Pascal, Rust, Swift, WebAssembly).
This pull request significantly expands the Go API for Text-to-Speech by adding support for PocketTTS. It introduces new configuration options for audio generation, allowing developers to fine-tune synthesis parameters. Furthermore, it provides practical examples for both basic TTS conversion and real-time audio playback, making it easier to integrate and experiment with PocketTTS in Go applications.
This pull request significantly refactors the Java Native Interface (JNI) layer for the `sherpa-onnx` library, primarily enhancing the `OfflineTts` component. The changes introduce more robust error handling in various API constructors by validating native object initialization. Furthermore, the callback mechanism for Text-to-Speech operations has been streamlined, offering more convenient `java.util.function.Consumer` based interfaces in Java while simplifying the underlying C++ JNI implementation.
### Highlights
* **Improved Error Handling in Constructors**: Added `IllegalArgumentException` throws in constructors of several `sherpa-onnx` Java API classes (e.g., `AudioTagging`, `KeywordSpotter`, `OfflineTts`) if the native object creation (`newFromFile`) returns a null pointer (0). This makes the API more robust by failing fast on invalid configurations.
* **Streamlined Offline TTS Callbacks**: The `OfflineTts` class now provides new `generateWithCallback` and `generateWithConfigAndCallback` overloads that accept `java.util.function.Consumer<float[]>` for simpler, more idiomatic Java callback usage. This reduces boilerplate for users who only need to consume audio samples.
* **Simplified JNI Callback Implementation**: The native C++ code (`offline-tts.cc`) has been refactored to remove separate handling for `Consumer` and `Function` interfaces. All callbacks are now handled uniformly through the `OfflineTtsCallback` interface, simplifying the JNI bridge logic.
* **Removed Unused Imports and Code**: The `PocketTts.java` example file was cleaned up by removing unused `Consumer` and `Function` imports and simplifying lambda expressions, reflecting the changes in the `OfflineTts` API.
* **Added `getNumSpeakers()` to `OfflineTts`**: A new method `getNumSpeakers()` was added to the `OfflineTts` class, providing access to the number of speakers supported by the TTS engine.
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
This PR adds support for Wenet non-streaming CTC models to sherpa-onnx by introducing the SherpaOnnxOfflineWenetCtcModelConfig struct and integrating it across all language bindings and APIs. The implementation follows the same pattern as other CTC model types like Zipformer CTC.
- Introduces SherpaOnnxOfflineWenetCtcModelConfig struct with a single model field for the ONNX model path
- Adds the new config to SherpaOnnxOfflineModelConfig and updates all language bindings (C++, Pascal, Kotlin, Java, Go, C#, Swift, JavaScript, etc.)
- Provides comprehensive examples and tests across all supported platforms and languages
This PR adds support for streaming T-one Russian ASR models across various language bindings in the sherpa-onnx library. The changes enable T-one CTC (Connectionist Temporal Classification) model integration by adding new configuration structures and example implementations.
- Introduces OnlineToneCtcModelConfig structures across all language bindings (C, C++, Swift, Java, Kotlin, Go, etc.)
- Adds T-one CTC model support to WASM implementations for both ASR and keyword spotting
- Provides comprehensive example implementations demonstrating T-one model usage in multiple programming languages
This PR simplifies the usage of the non-Android Java API by providing platform-specific JAR files that include native shared libraries, eliminating the need for users to manually manage native dependencies.
- Refactored LibraryUtils.java to support multiple library loading methods including extracting from JAR resources
- Added build infrastructure to create platform-specific native library JAR files
- Introduced debug capabilities and improved error handling for library loading
Add support for the NeMo Canary model in both Java and Kotlin APIs, wiring it through
JNI and updating examples and CI.
- Introduce OfflineCanaryModelConfig in Kotlin and Java with builder patterns
- Extend OfflineRecognizer to accept and apply the new canary config via setConfig
- Update JNI binding (GetOfflineConfig) and getOfflineModelConfig mapping (type 32),
plus examples and CI workflows