react-native-sherpa-onnx 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -0
- package/README.md +92 -21
- package/SherpaOnnx.podspec +3 -0
- package/THIRD_PARTY_LICENSES/README.md +62 -0
- package/THIRD_PARTY_LICENSES/ffmpeg.txt +502 -0
- package/THIRD_PARTY_LICENSES/libarchive.txt +65 -0
- package/THIRD_PARTY_LICENSES/nvidia_omla.txt +181 -0
- package/THIRD_PARTY_LICENSES/onnxruntime.txt +21 -0
- package/THIRD_PARTY_LICENSES/opus.txt +44 -0
- package/THIRD_PARTY_LICENSES/sherpa-onnx.txt +201 -0
- package/THIRD_PARTY_LICENSES/shine.txt +482 -0
- package/THIRD_PARTY_LICENSES/zstd.txt +30 -0
- package/android/build.gradle +7 -3
- package/android/prebuilt-download.gradle +344 -152
- package/android/prebuilt-versions.gradle +1 -1
- package/android/src/main/assets/model_licenses/asr-models-license-status.csv +409 -0
- package/android/src/main/assets/model_licenses/qnn-asr-models-license-status.csv +695 -0
- package/android/src/main/assets/model_licenses/tts-models-license-status.csv +596 -0
- package/android/src/main/cpp/CMakeLists.txt +28 -10
- package/android/src/main/cpp/jni/archive/sherpa-onnx-archive-helper.cpp +2 -2
- package/android/src/main/cpp/jni/audio/sherpa-onnx-audio-convert-jni.cpp +268 -2
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-tts.cpp +37 -6
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect.h +9 -1
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-tts-wrapper.cpp +7 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-validate-tts.cpp +18 -2
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxArchiveHelper.kt +40 -10
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxModule.kt +99 -0
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxOnlineSttHelper.kt +4 -1
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxTtsHelper.kt +127 -97
- package/ios/Resources/model_licenses/asr-models-license-status.csv +409 -0
- package/ios/Resources/model_licenses/qnn-asr-models-license-status.csv +695 -0
- package/ios/Resources/model_licenses/tts-models-license-status.csv +596 -0
- package/ios/SherpaOnnx+OnlineSTT.mm +2 -0
- package/ios/SherpaOnnx+PcmLiveStream.mm +2 -29
- package/ios/SherpaOnnx+TTS.mm +179 -20
- package/ios/SherpaOnnx.mm +54 -0
- package/ios/SherpaOnnxAudioConvert.h +10 -0
- package/ios/SherpaOnnxAudioConvert.mm +257 -1
- package/ios/archive/sherpa-onnx-archive-helper.h +3 -0
- package/ios/archive/sherpa-onnx-archive-helper.mm +39 -6
- package/ios/model_detect/sherpa-onnx-model-detect-tts.mm +49 -6
- package/ios/model_detect/sherpa-onnx-model-detect.h +9 -1
- package/ios/model_detect/sherpa-onnx-validate-tts.mm +18 -2
- package/ios/online_stt/sherpa-onnx-online-stt-wrapper.h +1 -0
- package/ios/online_stt/sherpa-onnx-online-stt-wrapper.mm +4 -0
- package/ios/tts/sherpa-onnx-tts-wrapper.h +37 -0
- package/ios/tts/sherpa-onnx-tts-wrapper.mm +158 -3
- package/lib/module/NativeSherpaOnnx.js.map +1 -1
- package/lib/module/audio/index.js +8 -0
- package/lib/module/audio/index.js.map +1 -1
- package/lib/module/download/ModelDownloadManager.js +10 -929
- package/lib/module/download/ModelDownloadManager.js.map +1 -1
- package/lib/module/download/activeModelOperations.js +26 -0
- package/lib/module/download/activeModelOperations.js.map +1 -0
- package/lib/module/download/background-downloader-types.js +2 -0
- package/lib/module/download/background-downloader-types.js.map +1 -0
- package/lib/module/download/bulkPurge.js +72 -0
- package/lib/module/download/bulkPurge.js.map +1 -0
- package/lib/module/download/checksumPrompt.js +19 -0
- package/lib/module/download/checksumPrompt.js.map +1 -0
- package/lib/module/download/constants.js +7 -0
- package/lib/module/download/constants.js.map +1 -0
- package/lib/module/download/downloadEvents.js +35 -0
- package/lib/module/download/downloadEvents.js.map +1 -0
- package/lib/module/download/downloadTask.js +438 -0
- package/lib/module/download/downloadTask.js.map +1 -0
- package/lib/module/download/ensureModel.js +89 -0
- package/lib/module/download/ensureModel.js.map +1 -0
- package/lib/module/download/index.js +4 -4
- package/lib/module/download/index.js.map +1 -1
- package/lib/module/download/localModels.js +151 -0
- package/lib/module/download/localModels.js.map +1 -0
- package/lib/module/download/modelExtraction.js +174 -0
- package/lib/module/download/modelExtraction.js.map +1 -0
- package/lib/module/download/paths.js +98 -0
- package/lib/module/download/paths.js.map +1 -0
- package/lib/module/download/postDownloadProcessing.js +206 -0
- package/lib/module/download/postDownloadProcessing.js.map +1 -0
- package/lib/module/download/protectedModelKeys.js +31 -0
- package/lib/module/download/protectedModelKeys.js.map +1 -0
- package/lib/module/download/registry.js +268 -0
- package/lib/module/download/registry.js.map +1 -0
- package/lib/module/download/retry.js +59 -0
- package/lib/module/download/retry.js.map +1 -0
- package/lib/module/download/types.js +17 -0
- package/lib/module/download/types.js.map +1 -0
- package/lib/module/download/validation.js +101 -5
- package/lib/module/download/validation.js.map +1 -1
- package/lib/module/{download → extraction}/extractTarBz2.js +3 -1
- package/lib/module/extraction/extractTarBz2.js.map +1 -0
- package/lib/module/{download → extraction}/extractTarZst.js +3 -1
- package/lib/module/extraction/extractTarZst.js.map +1 -0
- package/lib/module/extraction/index.js +3 -4
- package/lib/module/extraction/index.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/licenses.js +63 -0
- package/lib/module/licenses.js.map +1 -0
- package/lib/module/stt/index.js +16 -2
- package/lib/module/stt/index.js.map +1 -1
- package/lib/module/stt/streaming.js +2 -0
- package/lib/module/stt/streaming.js.map +1 -1
- package/lib/module/stt/streamingTypes.js.map +1 -1
- package/lib/module/stt/types.js.map +1 -1
- package/lib/module/tts/index.js +21 -3
- package/lib/module/tts/index.js.map +1 -1
- package/lib/module/tts/streaming.js +5 -1
- package/lib/module/tts/streaming.js.map +1 -1
- package/lib/module/tts/types.js +4 -1
- package/lib/module/tts/types.js.map +1 -1
- package/lib/module/utils.js +16 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/src/NativeSherpaOnnx.d.ts +34 -6
- package/lib/typescript/src/NativeSherpaOnnx.d.ts.map +1 -1
- package/lib/typescript/src/audio/index.d.ts +10 -0
- package/lib/typescript/src/audio/index.d.ts.map +1 -1
- package/lib/typescript/src/download/ModelDownloadManager.d.ts +11 -108
- package/lib/typescript/src/download/ModelDownloadManager.d.ts.map +1 -1
- package/lib/typescript/src/download/activeModelOperations.d.ts +6 -0
- package/lib/typescript/src/download/activeModelOperations.d.ts.map +1 -0
- package/lib/typescript/src/download/background-downloader-types.d.ts +64 -0
- package/lib/typescript/src/download/background-downloader-types.d.ts.map +1 -0
- package/lib/typescript/src/download/bulkPurge.d.ts +14 -0
- package/lib/typescript/src/download/bulkPurge.d.ts.map +1 -0
- package/lib/typescript/src/download/checksumPrompt.d.ts +3 -0
- package/lib/typescript/src/download/checksumPrompt.d.ts.map +1 -0
- package/lib/typescript/src/download/constants.d.ts +5 -0
- package/lib/typescript/src/download/constants.d.ts.map +1 -0
- package/lib/typescript/src/download/downloadEvents.d.ts +6 -0
- package/lib/typescript/src/download/downloadEvents.d.ts.map +1 -0
- package/lib/typescript/src/download/downloadTask.d.ts +30 -0
- package/lib/typescript/src/download/downloadTask.d.ts.map +1 -0
- package/lib/typescript/src/download/ensureModel.d.ts +26 -0
- package/lib/typescript/src/download/ensureModel.d.ts.map +1 -0
- package/lib/typescript/src/download/index.d.ts +7 -7
- package/lib/typescript/src/download/index.d.ts.map +1 -1
- package/lib/typescript/src/download/localModels.d.ts +15 -0
- package/lib/typescript/src/download/localModels.d.ts.map +1 -0
- package/lib/typescript/src/download/modelExtraction.d.ts +36 -0
- package/lib/typescript/src/download/modelExtraction.d.ts.map +1 -0
- package/lib/typescript/src/download/paths.d.ts +28 -0
- package/lib/typescript/src/download/paths.d.ts.map +1 -0
- package/lib/typescript/src/download/postDownloadProcessing.d.ts +19 -0
- package/lib/typescript/src/download/postDownloadProcessing.d.ts.map +1 -0
- package/lib/typescript/src/download/protectedModelKeys.d.ts +6 -0
- package/lib/typescript/src/download/protectedModelKeys.d.ts.map +1 -0
- package/lib/typescript/src/download/registry.d.ts +14 -0
- package/lib/typescript/src/download/registry.d.ts.map +1 -0
- package/lib/typescript/src/download/retry.d.ts +15 -0
- package/lib/typescript/src/download/retry.d.ts.map +1 -0
- package/lib/typescript/src/download/types.d.ts +96 -0
- package/lib/typescript/src/download/types.d.ts.map +1 -0
- package/lib/typescript/src/download/validation.d.ts +19 -0
- package/lib/typescript/src/download/validation.d.ts.map +1 -1
- package/lib/typescript/src/extraction/extractTarBz2.d.ts.map +1 -0
- package/lib/typescript/src/extraction/extractTarZst.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/licenses.d.ts +10 -0
- package/lib/typescript/src/licenses.d.ts.map +1 -0
- package/lib/typescript/src/stt/index.d.ts +4 -1
- package/lib/typescript/src/stt/index.d.ts.map +1 -1
- package/lib/typescript/src/stt/streaming.d.ts.map +1 -1
- package/lib/typescript/src/stt/streamingTypes.d.ts +5 -0
- package/lib/typescript/src/stt/streamingTypes.d.ts.map +1 -1
- package/lib/typescript/src/stt/types.d.ts +3 -1
- package/lib/typescript/src/stt/types.d.ts.map +1 -1
- package/lib/typescript/src/tts/index.d.ts +4 -2
- package/lib/typescript/src/tts/index.d.ts.map +1 -1
- package/lib/typescript/src/tts/streaming.d.ts.map +1 -1
- package/lib/typescript/src/tts/types.d.ts +12 -6
- package/lib/typescript/src/tts/types.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +5 -0
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/package.json +6 -1
- package/scripts/{check-model-csvs.sh → ci/check-model-csvs.sh} +9 -2
- package/scripts/ci/collect_all_sherpa_model_streams.sh +101 -0
- package/scripts/ci/collect_one_sherpa_release_stream.sh +189 -0
- package/scripts/ci/sherpa_asr_model_release_streams.json +21 -0
- package/scripts/ci/sherpa_tts_model_release_streams.json +13 -0
- package/scripts/ci/update_model_license_csv.sh +765 -0
- package/scripts/setup-ios-framework.sh +14 -11
- package/scripts/update_commercial_use.js +73 -0
- package/src/NativeSherpaOnnx.ts +37 -6
- package/src/audio/index.ts +20 -0
- package/src/download/ModelDownloadManager.ts +57 -1343
- package/src/download/activeModelOperations.ts +38 -0
- package/src/download/background-downloader-types.ts +73 -0
- package/src/download/bulkPurge.ts +102 -0
- package/src/download/checksumPrompt.ts +25 -0
- package/src/download/constants.ts +5 -0
- package/src/download/downloadEvents.ts +55 -0
- package/src/download/downloadTask.ts +565 -0
- package/src/download/ensureModel.ts +124 -0
- package/src/download/index.ts +21 -4
- package/src/download/localModels.ts +234 -0
- package/src/download/modelExtraction.ts +244 -0
- package/src/download/paths.ts +134 -0
- package/src/download/postDownloadProcessing.ts +292 -0
- package/src/download/protectedModelKeys.ts +30 -0
- package/src/download/registry.ts +405 -0
- package/src/download/retry.ts +76 -0
- package/src/download/types.ts +120 -0
- package/src/download/validation.ts +114 -8
- package/src/{download → extraction}/extractTarBz2.ts +3 -1
- package/src/{download → extraction}/extractTarZst.ts +3 -1
- package/src/extraction/index.ts +3 -7
- package/src/index.tsx +1 -0
- package/src/licenses.ts +100 -0
- package/src/stt/index.ts +20 -2
- package/src/stt/streaming.ts +3 -0
- package/src/stt/streamingTypes.ts +5 -0
- package/src/stt/types.ts +3 -1
- package/src/tts/index.ts +33 -2
- package/src/tts/streaming.ts +12 -0
- package/src/tts/types.ts +15 -5
- package/src/utils.ts +22 -1
- package/third_party/sherpa-onnx-prebuilt/ANDROID_RELEASE_TAG +1 -1
- package/third_party/sherpa-onnx-prebuilt/IOS_RELEASE_TAG +1 -1
- package/android/src/main/cpp/jni/tts/sherpa-onnx-tts-zipvoice-jni.cpp +0 -301
- package/android/src/main/java/com/sherpaonnx/ZipvoiceTtsWrapper.kt +0 -187
- package/lib/module/download/extractTarBz2.js.map +0 -1
- package/lib/module/download/extractTarZst.js.map +0 -1
- package/lib/typescript/src/download/extractTarBz2.d.ts.map +0 -1
- package/lib/typescript/src/download/extractTarZst.d.ts.map +0 -1
- package/scripts/check-qnn-support.sh +0 -78
- /package/lib/typescript/src/{download → extraction}/extractTarBz2.d.ts +0 -0
- /package/lib/typescript/src/{download → extraction}/extractTarZst.d.ts +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026 XDcobra
|
|
4
|
+
|
|
4
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
6
7
|
in the Software without restriction, including without limitation the rights
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ No additional setup required. The library automatically handles native dependenc
|
|
|
48
48
|
|
|
49
49
|
### iOS
|
|
50
50
|
|
|
51
|
-
The sherpa-onnx **XCFramework is not shipped in the repo or npm** (size ~80MB). It is **downloaded automatically** when you run `pod install`; no manual steps are required. The version used is pinned in `third_party/sherpa-onnx-prebuilt/IOS_RELEASE_TAG` and the archive is fetched from [GitHub Releases](https://github.com/XDcobra/react-native-sherpa-onnx/releases?q=
|
|
51
|
+
The sherpa-onnx **XCFramework is not shipped in the repo or npm** (size ~80MB). It is **downloaded automatically** when you run `pod install`; no manual steps are required. The version used is pinned in `third_party/sherpa-onnx-prebuilt/IOS_RELEASE_TAG` (format: `sherpa-onnx-ios-vX.Y.Z` or `sherpa-onnx-ios-vX.Y.Z-N` with optional build number) and the archive is fetched from [GitHub Releases](https://github.com/XDcobra/react-native-sherpa-onnx/releases?q=sherpa-onnx-ios).
|
|
52
52
|
|
|
53
53
|
#### Setup
|
|
54
54
|
|
|
@@ -62,15 +62,33 @@ The podspec runs `scripts/setup-ios-framework.sh`, which downloads the XCFramewo
|
|
|
62
62
|
|
|
63
63
|
#### Building the iOS framework
|
|
64
64
|
|
|
65
|
-
To build the sherpa-onnx iOS XCFramework yourself (e.g. custom version or patches), see [third_party/sherpa-onnx-prebuilt/README.md](third_party/sherpa-onnx-prebuilt/README.md) and the [
|
|
65
|
+
To build the sherpa-onnx iOS XCFramework yourself (e.g. custom version or patches), see [third_party/sherpa-onnx-prebuilt/README.md](third_party/sherpa-onnx-prebuilt/README.md) and the [Framework - Sherpa-Onnx (iOS) Release](.github/workflows/framework-sherpa-onnx-ios-framework.yml) workflow.
|
|
66
|
+
|
|
67
|
+
#### Model download (optional)
|
|
68
|
+
|
|
69
|
+
If you use the [download manager](docs/download-manager.md) to fetch models at runtime, add the following to your **AppDelegate** so background downloads can finish when the app is in the background or after it was terminated. Without it, downloads only work reliably while the app is in the foreground.
|
|
70
|
+
|
|
71
|
+
- **Swift (RN 0.77+):** In your bridging header add `#import <RNBackgroundDownloader.h>`. In `AppDelegate.swift`, implement:
|
|
72
|
+
```swift
|
|
73
|
+
func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
|
|
74
|
+
RNBackgroundDownloader.setCompletionHandlerWithIdentifier(identifier, completionHandler: completionHandler)
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
- **Objective-C:** In `AppDelegate.m` add `#import <RNBackgroundDownloader.h>` and the `application:handleEventsForBackgroundURLSession:completionHandler:` implementation that calls `[RNBackgroundDownloader setCompletionHandlerWithIdentifier:identifier completionHandler:completionHandler]`.
|
|
78
|
+
|
|
79
|
+
Full step-by-step: [Download manager – Setup (iOS & Android)](docs/download-manager.md#setup-ios--android). Expo users can use the library’s config plugin to apply this automatically.
|
|
80
|
+
|
|
81
|
+
**Android:** Foreground service permissions (Play Console), visible download notifications, and **`POST_NOTIFICATIONS` (API 33+)** are covered in [Download manager – Android: foreground service & notifications](docs/download-manager.md#android-foreground-service--notifications).
|
|
66
82
|
|
|
67
83
|
## Table of contents
|
|
68
84
|
|
|
85
|
+
- [Bundled sherpa-onnx version](#bundled-sherpa-onnx-version)
|
|
69
86
|
- [Installation](#installation)
|
|
70
87
|
- [Android](#android)
|
|
71
88
|
- [iOS](#ios)
|
|
72
89
|
- [Feature Support](#feature-support)
|
|
73
90
|
- [Platform Support Status](#platform-support-status)
|
|
91
|
+
- [Known issues](#known-issues)
|
|
74
92
|
- [Supported Model Types](#supported-model-types)
|
|
75
93
|
- [Speech-to-Text (STT) Models](#speech-to-text-stt-models)
|
|
76
94
|
- [Text-to-Speech (TTS) Models](#text-to-speech-tts-models)
|
|
@@ -86,25 +104,32 @@ To build the sherpa-onnx iOS XCFramework yourself (e.g. custom version or patche
|
|
|
86
104
|
- [Contributing](#contributing)
|
|
87
105
|
- [License](#license)
|
|
88
106
|
|
|
107
|
+
## Bundled sherpa-onnx version
|
|
108
|
+
|
|
109
|
+
| Platform | Version |
|
|
110
|
+
|----------|---------|
|
|
111
|
+
| Android | 1.12.31 |
|
|
112
|
+
| iOS | 1.12.31 |
|
|
113
|
+
|
|
89
114
|
## Feature Support
|
|
90
115
|
|
|
91
|
-
| Feature | Status | Notes |
|
|
92
|
-
|
|
93
|
-
| Offline Speech-to-Text | ✅ **Supported** | No internet required; multiple model types (Zipformer, Paraformer, Whisper, etc.). See [Supported Model Types](#supported-model-types)
|
|
94
|
-
| Online (streaming) Speech-to-Text | ✅ **Supported** | Real-time recognition from microphone or stream; partial results, endpoint detection. Use streaming-capable models (e.g. transducer, paraformer).
|
|
95
|
-
| Live capture API | ✅ **Supported** | Native microphone capture with resampling for live transcription (use with streaming STT).
|
|
96
|
-
| Text-to-Speech | ✅ **Supported** | Multiple model types (VITS, Matcha, Kokoro, etc.). See [Supported Model Types](#supported-model-types)
|
|
97
|
-
| Streaming Text-to-Speech | ✅ **Supported** | Incremental speech generation for low time-to-first-byte and playback while generating.
|
|
98
|
-
| Execution providers (CPU, NNAPI, XNNPACK, Core ML, QNN) | ✅ **Supported** |
|
|
99
|
-
| Play Asset Delivery (PAD) | ✅ **Supported** |
|
|
100
|
-
| Automatic Model type detection | ✅ **Supported** | `detectSttModel()` and `detectTtsModel()` for a path.
|
|
101
|
-
| Model quantization | ✅ **Supported** | Automatic detection and preference for quantized (int8) models. |
|
|
102
|
-
| Flexible model loading | ✅ **Supported** | Asset models, file system models, or auto-detection. |
|
|
103
|
-
| TypeScript | ✅ **Supported** | Full type definitions included. |
|
|
104
|
-
| Speaker Diarization | ❌ Not yet supported | Scheduled for release 0.4.0 |
|
|
105
|
-
| Speech Enhancement | ❌ Not yet supported | Scheduled for release 0.5.0 |
|
|
106
|
-
| Source Separation | ❌ Not yet supported | Scheduled for release 0.6.0 |
|
|
107
|
-
| VAD (Voice Activity Detection) | ❌ Not yet supported | Scheduled for release 0.7.0 |
|
|
116
|
+
| Feature | Status | Docs | Notes |
|
|
117
|
+
|---------|--------|------|-------|
|
|
118
|
+
| Offline Speech-to-Text | ✅ **Supported** | [STT](./docs/stt.md) | No internet required; multiple model types (Zipformer, Paraformer, Whisper, etc.). See [Supported Model Types](#supported-model-types). |
|
|
119
|
+
| Online (streaming) Speech-to-Text | ✅ **Supported** | [Streaming STT](./docs/stt-streaming.md) | Real-time recognition from microphone or stream; partial results, endpoint detection. Use streaming-capable models (e.g. transducer, paraformer). |
|
|
120
|
+
| Live capture API | ✅ **Supported** | [PCM live stream](./docs/pcm-live-stream.md) | Native microphone capture with resampling for live transcription (use with streaming STT). |
|
|
121
|
+
| Text-to-Speech | ✅ **Supported** | [TTS](./docs/tts.md) | Multiple model types (VITS, Matcha, Kokoro, etc.). See [Supported Model Types](#supported-model-types). |
|
|
122
|
+
| Streaming Text-to-Speech | ✅ **Supported** | [Streaming TTS](./docs/tts-streaming.md) | Incremental speech generation for low time-to-first-byte and playback while generating. |
|
|
123
|
+
| Execution providers (CPU, NNAPI, XNNPACK, Core ML, QNN) | ✅ **Supported** | [Execution providers](./docs/execution-providers.md) | CPU default; optional accelerators per platform. |
|
|
124
|
+
| Play Asset Delivery (PAD) | ✅ **Supported** | [Model setup](./docs/model-setup.md) | Android only. Archives: [Extraction API](./docs/extraction.md). |
|
|
125
|
+
| Automatic Model type detection | ✅ **Supported** | [Model detection](./docs/model-setup.md#model-detection) | `detectSttModel()` and `detectTtsModel()` for a path. |
|
|
126
|
+
| Model quantization | ✅ **Supported** | [Model setup](./docs/model-setup.md) | Automatic detection and preference for quantized (int8) models. |
|
|
127
|
+
| Flexible model loading | ✅ **Supported** | [Model setup](./docs/model-setup.md) | Asset models, file system models, or auto-detection. |
|
|
128
|
+
| TypeScript | ✅ **Supported** | — | Full type definitions included. |
|
|
129
|
+
| Speaker Diarization | ❌ Not yet supported | [Diarization](./docs/diarization.md) | Scheduled for release 0.4.0 |
|
|
130
|
+
| Speech Enhancement | ❌ Not yet supported | [Enhancement](./docs/enhancement.md) | Scheduled for release 0.5.0 |
|
|
131
|
+
| Source Separation | ❌ Not yet supported | [Separation](./docs/separation.md) | Scheduled for release 0.6.0 |
|
|
132
|
+
| VAD (Voice Activity Detection) | ❌ Not yet supported | [VAD](./docs/vad.md) | Scheduled for release 0.7.0 |
|
|
108
133
|
|
|
109
134
|
## Platform Support Status
|
|
110
135
|
|
|
@@ -113,6 +138,10 @@ To build the sherpa-onnx iOS XCFramework yourself (e.g. custom version or patche
|
|
|
113
138
|
| **Android** | ✅ **Production Ready** | CI/CD automated, multiple models supported |
|
|
114
139
|
| **iOS** | ✅ **Production Ready** | CI/CD automated, multiple models supported |
|
|
115
140
|
|
|
141
|
+
## Known issues
|
|
142
|
+
|
|
143
|
+
- **[Pocket TTS (voice cloning)](docs/KNOWN_ISSUES.md)** — voice cloning: **Android** supported; **iOS** experimental. Heuristic EOS and **iOS vs Android drift** (length/quality); not a React Native–only issue. Full notes: [investigation doc](docs/github-issue-pocket-tts-eos-frame-zero.md).
|
|
144
|
+
|
|
116
145
|
## Supported Model Types
|
|
117
146
|
|
|
118
147
|
### Speech-to-Text (STT) Models
|
|
@@ -147,13 +176,15 @@ For **real-time (streaming) recognition** from a microphone or audio stream, use
|
|
|
147
176
|
| **Matcha** | `'matcha'` | High-quality acoustic model + vocoder. Detected by acoustic_model + vocoder; no folder token required. | [Download](https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html) |
|
|
148
177
|
| **Kokoro** | `'kokoro'` | Multi-speaker, multi-language. Folder name should contain **kokoro** (not kitten) for auto-detection. | [Download](https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models) |
|
|
149
178
|
| **KittenTTS** | `'kitten'` | Lightweight, multi-speaker. Folder name should contain **kitten** (not kokoro) for auto-detection. | [Download](https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models) |
|
|
150
|
-
| **Zipvoice** | `'zipvoice'` | Voice cloning (
|
|
151
|
-
| **Pocket** | `'pocket'` | Flow-matching TTS. Detected by lm_flow, lm_main, text_conditioner, vocab/token_scores
|
|
179
|
+
| **Zipvoice** | `'zipvoice'` | Standard TTS with **`sid`**. **Voice cloning** (reference audio + `referenceText`): batch via **`generateSpeech`** only—streaming TTS does not support reference audio for Zipvoice. Default **`numSteps`** when omitted is **5** on **Android and iOS** (matches sherpa-onnx `GenerationConfig` / Kotlin helper). Cloning is **supported on Android & iOS**. Encoder + decoder + vocoder. | [Download](https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/zipvoice.html) |
|
|
180
|
+
| **Pocket** | `'pocket'` | Flow-matching TTS. **Voice cloning** on **Android:** batch and streaming TTS. **iOS:** cloning is experimental. Detected by lm_flow, lm_main, text_conditioner, vocab/token_scores. | [Download](https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models) |
|
|
181
|
+
| **Supertonic** | `'supertonic'` | Lightning-fast, on-device text-to-speech system designed for extreme performance with minimal computational overhead. | [Download](https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models) |
|
|
152
182
|
|
|
153
183
|
For **streaming TTS** (incremental generation, low latency), use `createStreamingTTS()` with supported model types. See [Streaming Text-to-Speech](./docs/tts-streaming.md).
|
|
154
184
|
|
|
155
185
|
## Documentation
|
|
156
186
|
|
|
187
|
+
- [Known issues](./docs/KNOWN_ISSUES.md) – SDK-facing notes (e.g. Pocket TTS cloning / cross-platform behavior)
|
|
157
188
|
- [Speech-to-Text (STT)](./docs/stt.md) – Offline transcription (file or samples)
|
|
158
189
|
- [Streaming (Online) Speech-to-Text](./docs/stt-streaming.md) – Real-time recognition, partial results, endpoint detection
|
|
159
190
|
- [PCM Live Stream](./docs/pcm-live-stream.md) – Native microphone capture with resampling for live transcription (use with streaming STT)
|
|
@@ -248,6 +279,46 @@ This app showcases how to integrate `react-native-sherpa-onnx` into a real-world
|
|
|
248
279
|
|
|
249
280
|
MIT
|
|
250
281
|
|
|
282
|
+
## Third-Party Libraries
|
|
283
|
+
|
|
284
|
+
This SDK includes the following open source components:
|
|
285
|
+
|
|
286
|
+
- [sherpa-onnx (Apache License 2.0)](/THIRD_PARTY_LICENSES/sherpa-onnx.txt): https://github.com/k2-fsa/sherpa-onnx
|
|
287
|
+
|
|
288
|
+
- [ONNX Runtime (MIT License)](/THIRD_PARTY_LICENSES/onnxruntime.txt): https://github.com/microsoft/onnxruntime
|
|
289
|
+
|
|
290
|
+
- [FFmpeg (LGPL v2.1)](/THIRD_PARTY_LICENSES/ffmpeg.txt): https://ffmpeg.org
|
|
291
|
+
|
|
292
|
+
- [Shine MP3 Encoder (LGPL)](/THIRD_PARTY_LICENSES/shine.txt): https://github.com/toots/shine
|
|
293
|
+
|
|
294
|
+
- [Opus Codec (BSD License)](/THIRD_PARTY_LICENSES/opus.txt): https://opus-codec.org
|
|
295
|
+
|
|
296
|
+
- [Zstandard (zstd) (BSD License)](/THIRD_PARTY_LICENSES/zstd.txt): https://github.com/facebook/zstd
|
|
297
|
+
|
|
298
|
+
- [libarchive (BSD License)](/THIRD_PARTY_LICENSES/libarchive.txt): https://github.com/libarchive/libarchive
|
|
299
|
+
|
|
300
|
+
Full license texts are available in the [THIRD_PARTY_LICENSES](/THIRD_PARTY_LICENSES/) directory.
|
|
301
|
+
|
|
302
|
+
### LGPL Notice
|
|
303
|
+
|
|
304
|
+
This SDK includes LGPL-licensed components such as FFmpeg and Shine.
|
|
305
|
+
Applications using this SDK must ensure compliance with LGPL requirements when distributing binaries.
|
|
306
|
+
|
|
307
|
+
FFmpeg source code can be obtained at: https://ffmpeg.org
|
|
308
|
+
|
|
309
|
+
### Qualcomm QNN Support
|
|
310
|
+
|
|
311
|
+
This SDK supports optional integration with Qualcomm AI Runtime (QNN).
|
|
312
|
+
|
|
313
|
+
QNN is proprietary software provided by Qualcomm and is not included in this SDK.
|
|
314
|
+
To use QNN acceleration, users must obtain and include the required QNN libraries separately and comply with Qualcomm's license terms:
|
|
315
|
+
|
|
316
|
+
https://softwarecenter.qualcomm.com/
|
|
317
|
+
|
|
318
|
+
### Responsibility
|
|
319
|
+
|
|
320
|
+
By using this SDK, you are responsible for complying with all third-party licenses included in this project.
|
|
321
|
+
|
|
251
322
|
---
|
|
252
323
|
|
|
253
324
|
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
package/SherpaOnnx.podspec
CHANGED
|
@@ -139,5 +139,8 @@ Pod::Spec.new do |s|
|
|
|
139
139
|
|
|
140
140
|
s.libraries = "c++", "z", "iconv", "bz2"
|
|
141
141
|
|
|
142
|
+
# Per-release-model license metadata (synced from CI; same CSV as android/src/main/assets/model_licenses/).
|
|
143
|
+
s.resources = ["ios/Resources/model_licenses/*.csv"]
|
|
144
|
+
|
|
142
145
|
install_modules_dependencies(s)
|
|
143
146
|
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Third-party license texts
|
|
2
|
+
|
|
3
|
+
This directory contains **full license texts** for libraries shipped with this module (e.g. sherpa-onnx, ONNX Runtime, FFmpeg). See the repository [README](../README.md#third-party-libraries) for links.
|
|
4
|
+
|
|
5
|
+
## Prebuilt model release assets (per-model metadata)
|
|
6
|
+
|
|
7
|
+
**Model-specific license status** (which release `.tar.bz2` / asset has which `license_type`, `commercial_use`, provenance URL, etc.) is **not** stored here.
|
|
8
|
+
|
|
9
|
+
It is maintained as CSV and **bundled with the native library** so apps can ship it without extra Metro assets:
|
|
10
|
+
|
|
11
|
+
| Platform | Path (in this repo) |
|
|
12
|
+
|----------|---------------------|
|
|
13
|
+
| **Android** | [`android/src/main/assets/model_licenses/`](../android/src/main/assets/model_licenses/) |
|
|
14
|
+
| **iOS** | [`ios/Resources/model_licenses/`](../ios/Resources/model_licenses/) |
|
|
15
|
+
|
|
16
|
+
Files:
|
|
17
|
+
|
|
18
|
+
- `asr-models-license-status.csv` — ASR / STT release models
|
|
19
|
+
- `tts-models-license-status.csv` — TTS release models
|
|
20
|
+
|
|
21
|
+
Columns: `asset_name`, `license_type`, `commercial_use`, `confidence`, `detection_source`, `license_file`.
|
|
22
|
+
|
|
23
|
+
Set `detection_source` to `manual` for rows you maintain by hand; `scripts/ci/update_model_license_csv.sh` **never** re-scans or overwrites those assets (clear `manual` if you want automation to run again).
|
|
24
|
+
|
|
25
|
+
CI updates these CSVs via `scripts/ci/update_model_license_csv.sh`, which writes the primary file passed with `--csv` and **syncs the same content** to both Android and iOS paths above.
|
|
26
|
+
|
|
27
|
+
**Not legal advice** — consumers should verify licenses for their use case.
|
|
28
|
+
|
|
29
|
+
## License Types & Commercial Use
|
|
30
|
+
|
|
31
|
+
The following table explains the `license_type` and `commercial_use` values used in the CSV metadata.
|
|
32
|
+
|
|
33
|
+
| License Type | Commercial Use | Notes | Reference |
|
|
34
|
+
| :--- | :--- | :--- | :--- |
|
|
35
|
+
| **agpl-3.0** | `conditional` | Strong copyleft; requires source code disclosure if the model is used over a network. | [GNU AGPL v3](https://opensource.org/license/agpl-v3/) |
|
|
36
|
+
| **apache-2.0** | `yes` | Permissive license; allows commercial use, modification, and redistribution. | [Apache 2.0](https://opensource.org/license/apache-2-0/) |
|
|
37
|
+
| **bsd-3-clause** | `yes` | Permissive license; similar to MIT but includes a non-endorsement clause. | [BSD 3-Clause](https://opensource.org/license/bsd-3-clause/) |
|
|
38
|
+
| **cc-by** | `yes` | Attribution required; allows commercial use. | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
|
|
39
|
+
| **cc-by-3.0** | `yes` | Attribution required; allows commercial use. | [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) |
|
|
40
|
+
| **cc-by-4.0** | `yes` | Attribution required; allows commercial use. | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
|
|
41
|
+
| **cc-by-nc-4.0** | `no` | **Non-Commercial** use only. | [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) |
|
|
42
|
+
| **cc-by-nc-nd-4.0** | `no` | **Non-Commercial** and no derivatives/modifications allowed. | [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/) |
|
|
43
|
+
| **cc-by-nc-sa-4.0** | `no` | **Non-Commercial** and Share-Alike (derivatives must be under the same license). | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) |
|
|
44
|
+
| **cc-by-sa** | `conditional` | Share-Alike; commercial use allowed, but any derivative must be under the same license. | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) |
|
|
45
|
+
| **cc-by-sa-3.0-es** | `conditional` | Share-Alike (Spain jurisdiction). | [CC BY-SA 3.0 ES](https://creativecommons.org/licenses/by-sa/3.0/es/) |
|
|
46
|
+
| **cc-by-sa-4.0** | `conditional` | Share-Alike; commercial use allowed, but any derivative must be under the same license. | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) |
|
|
47
|
+
| **cc0** | `yes` | Public domain; no restrictions on use. | [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/) |
|
|
48
|
+
| **gpl-2.0** | `conditional` | Copyleft; requires sharing the source code of any derivative works. | [GNU GPL v2](https://opensource.org/license/gpl-2-0/) |
|
|
49
|
+
| **mit** | `yes` | Highly permissive; allows commercial use with simple attribution. | [MIT](https://opensource.org/license/mit/) |
|
|
50
|
+
| **ngc-terms-of-use** | `restricted` | NVIDIA NGC Terms; often restricts redistribution or specific commercial weight use. | [Terms](https://ngc.nvidia.com/legal/terms) |
|
|
51
|
+
| **no-license** | `no` | No explicit permission granted; all rights reserved by the author. | N/A |
|
|
52
|
+
| **nvidia-open-model-license** | `yes` | Allows commercial use under specific conditions (e.g. no benchmarking). | [License](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/) |
|
|
53
|
+
| **proprietary-restricted** | `no` | Closed or custom license with significant restrictions. | N/A |
|
|
54
|
+
| **public-domain** | `yes` | Free for any use; no copyright protection. | N/A |
|
|
55
|
+
| **research-only** | `no` | Limited strictly to non-commercial research and evaluation. | N/A |
|
|
56
|
+
| **unlicense** | `yes` | Public domain equivalent; no restrictions. | [Unlicense](https://unlicense.org/) |
|
|
57
|
+
|
|
58
|
+
### Commercial Use Status Definitions:
|
|
59
|
+
- **`yes`**: Allowed for commercial purposes with minimal restrictions (permissive).
|
|
60
|
+
- **`no`**: Explicitly forbidden for commercial purposes.
|
|
61
|
+
- **`conditional`**: Allowed, but requires adherence to specific distribution/license conditions (e.g. copyleft).
|
|
62
|
+
- **`restricted`**: Limited use or redistribution permitted; requires careful legal review.
|