react-native-sherpa-onnx 0.2.0 → 0.3.0
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/README.md +232 -236
- package/SherpaOnnx.podspec +68 -64
- package/android/build.gradle +182 -192
- package/android/codegen.gradle +57 -0
- package/android/prebuilt-download.gradle +428 -0
- package/android/prebuilt-versions.gradle +43 -0
- package/android/proguard-rules.pro +10 -0
- package/android/src/main/assets/testModels/add_mul_add.onnx +28 -0
- package/android/src/main/assets/testModels/nnapi_internal_uint8_support.onnx +0 -0
- package/android/src/main/assets/testModels/qnn_multi_ctx_embed.onnx +0 -0
- package/android/src/main/cpp/CMakeLists.txt +166 -129
- package/android/src/main/cpp/CMakePresets.json +54 -0
- package/android/src/main/cpp/crypto/sha256.cpp +174 -0
- package/android/src/main/cpp/crypto/sha256.h +16 -0
- package/android/src/main/cpp/jni/archive/sherpa-onnx-archive-helper.cpp +404 -0
- package/android/src/main/cpp/jni/archive/sherpa-onnx-archive-helper.h +56 -0
- package/android/src/main/cpp/jni/archive/sherpa-onnx-archive-jni.cpp +181 -0
- package/android/src/main/cpp/jni/audio/sherpa-onnx-audio-convert-jni.cpp +888 -0
- package/{ios → android/src/main/cpp/jni/model_detect}/sherpa-onnx-common.h +18 -18
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-detect-jni-common.cpp +86 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-detect-jni-common.h +20 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-helper.cpp +423 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-helper.h +55 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-stt.cpp +399 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-tts.cpp +238 -0
- package/{ios → android/src/main/cpp/jni/model_detect}/sherpa-onnx-model-detect.h +122 -89
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-stt-wrapper.cpp +99 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-stt-wrapper.h +16 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-tts-wrapper.cpp +78 -0
- package/android/src/main/cpp/jni/model_detect/sherpa-onnx-tts-wrapper.h +16 -0
- package/android/src/main/cpp/jni/module/sherpa-onnx-module-jni.cpp +190 -0
- package/android/src/main/cpp/jni/tts/sherpa-onnx-tts-zipvoice-jni.cpp +301 -0
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxArchiveHelper.kt +94 -0
- package/android/src/main/java/com/sherpaonnx/{SherpaOnnxCoreHelper.kt → SherpaOnnxAssetHelper.kt} +350 -236
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxModule.kt +791 -483
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxSttHelper.kt +699 -109
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxTtsHelper.kt +1123 -668
- package/android/src/main/java/com/sherpaonnx/ZipvoiceTtsWrapper.kt +187 -0
- package/ios/SherpaOnnx+Assets.h +11 -0
- package/ios/SherpaOnnx+Assets.mm +325 -0
- package/ios/SherpaOnnx+STT.mm +455 -118
- package/ios/SherpaOnnx+TTS.mm +1101 -712
- package/ios/SherpaOnnx.h +17 -6
- package/ios/SherpaOnnx.mm +206 -311
- package/ios/SherpaOnnx.xcconfig +19 -19
- package/ios/SherpaOnnxCoreMLHelper.swift +24 -0
- package/ios/archive/sherpa-onnx-archive-helper.h +21 -0
- package/ios/archive/sherpa-onnx-archive-helper.mm +296 -0
- package/ios/libarchive_darwin_config.h +153 -0
- package/{android/src/main/cpp/jni → ios/model_detect}/sherpa-onnx-common.h +18 -18
- package/ios/model_detect/sherpa-onnx-model-detect-helper.h +49 -0
- package/ios/model_detect/sherpa-onnx-model-detect-helper.mm +210 -0
- package/ios/model_detect/sherpa-onnx-model-detect-stt.mm +344 -0
- package/ios/model_detect/sherpa-onnx-model-detect-tts.mm +201 -0
- package/{android/src/main/cpp/jni → ios/model_detect}/sherpa-onnx-model-detect.h +117 -89
- package/ios/scripts/patch-libarchive-includes.sh +61 -0
- package/ios/scripts/setup-ios-libarchive.sh +98 -0
- package/ios/stt/sherpa-onnx-stt-wrapper.h +129 -0
- package/ios/stt/sherpa-onnx-stt-wrapper.mm +523 -0
- package/ios/{sherpa-onnx-tts-wrapper.h → tts/sherpa-onnx-tts-wrapper.h} +90 -85
- package/ios/{sherpa-onnx-tts-wrapper.mm → tts/sherpa-onnx-tts-wrapper.mm} +376 -345
- package/lib/module/NativeSherpaOnnx.js +3 -0
- package/lib/module/NativeSherpaOnnx.js.map +1 -1
- package/lib/module/audio/index.js +22 -0
- package/lib/module/audio/index.js.map +1 -0
- package/lib/module/diarization/index.js +1 -1
- package/lib/module/diarization/index.js.map +1 -1
- package/lib/module/download/ModelDownloadManager.js +918 -0
- package/lib/module/download/ModelDownloadManager.js.map +1 -0
- package/lib/module/download/extractTarBz2.js +53 -0
- package/lib/module/download/extractTarBz2.js.map +1 -0
- package/lib/module/download/index.js +6 -0
- package/lib/module/download/index.js.map +1 -0
- package/lib/module/download/validation.js +178 -0
- package/lib/module/download/validation.js.map +1 -0
- package/lib/module/enhancement/index.js +1 -1
- package/lib/module/enhancement/index.js.map +1 -1
- package/lib/module/index.js +41 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/separation/index.js +1 -1
- package/lib/module/separation/index.js.map +1 -1
- package/lib/module/stt/index.js +127 -60
- package/lib/module/stt/index.js.map +1 -1
- package/lib/module/stt/sttModelLanguages.js +512 -0
- package/lib/module/stt/sttModelLanguages.js.map +1 -0
- package/lib/module/stt/types.js +53 -1
- package/lib/module/stt/types.js.map +1 -1
- package/lib/module/tts/index.js +216 -289
- package/lib/module/tts/index.js.map +1 -1
- package/lib/module/tts/types.js +86 -1
- package/lib/module/tts/types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils.js +86 -73
- package/lib/module/utils.js.map +1 -1
- package/lib/module/vad/index.js +1 -1
- package/lib/module/vad/index.js.map +1 -1
- package/lib/typescript/src/NativeSherpaOnnx.d.ts +192 -38
- package/lib/typescript/src/NativeSherpaOnnx.d.ts.map +1 -1
- package/lib/typescript/src/audio/index.d.ts +13 -0
- package/lib/typescript/src/audio/index.d.ts.map +1 -0
- package/lib/typescript/src/diarization/index.d.ts +3 -2
- package/lib/typescript/src/diarization/index.d.ts.map +1 -1
- package/lib/typescript/src/download/ModelDownloadManager.d.ts +108 -0
- package/lib/typescript/src/download/ModelDownloadManager.d.ts.map +1 -0
- package/lib/typescript/src/download/extractTarBz2.d.ts +14 -0
- package/lib/typescript/src/download/extractTarBz2.d.ts.map +1 -0
- package/lib/typescript/src/download/index.d.ts +7 -0
- package/lib/typescript/src/download/index.d.ts.map +1 -0
- package/lib/typescript/src/download/validation.d.ts +57 -0
- package/lib/typescript/src/download/validation.d.ts.map +1 -0
- package/lib/typescript/src/enhancement/index.d.ts +3 -2
- package/lib/typescript/src/enhancement/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +26 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/separation/index.d.ts +3 -2
- package/lib/typescript/src/separation/index.d.ts.map +1 -1
- package/lib/typescript/src/stt/index.d.ts +31 -43
- package/lib/typescript/src/stt/index.d.ts.map +1 -1
- package/lib/typescript/src/stt/sttModelLanguages.d.ts +52 -0
- package/lib/typescript/src/stt/sttModelLanguages.d.ts.map +1 -0
- package/lib/typescript/src/stt/types.d.ts +196 -9
- package/lib/typescript/src/stt/types.d.ts.map +1 -1
- package/lib/typescript/src/tts/index.d.ts +25 -211
- package/lib/typescript/src/tts/index.d.ts.map +1 -1
- package/lib/typescript/src/tts/types.d.ts +148 -25
- package/lib/typescript/src/tts/types.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +0 -32
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +28 -13
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/lib/typescript/src/vad/index.d.ts +3 -2
- package/lib/typescript/src/vad/index.d.ts.map +1 -1
- package/package.json +250 -222
- package/scripts/check-qnn-support.sh +78 -0
- package/scripts/setup-ios-framework.sh +379 -282
- package/src/NativeSherpaOnnx.ts +474 -251
- package/src/audio/index.ts +32 -0
- package/src/diarization/index.ts +4 -2
- package/src/download/ModelDownloadManager.ts +1325 -0
- package/src/download/extractTarBz2.ts +78 -0
- package/src/download/index.ts +43 -0
- package/src/download/validation.ts +279 -0
- package/src/enhancement/index.ts +4 -2
- package/src/index.tsx +78 -27
- package/src/separation/index.ts +4 -2
- package/src/stt/index.ts +249 -89
- package/src/stt/sttModelLanguages.ts +237 -0
- package/src/stt/types.ts +263 -9
- package/src/tts/index.ts +470 -458
- package/src/tts/types.ts +373 -218
- package/src/types.ts +0 -44
- package/src/utils.ts +145 -131
- package/src/vad/index.ts +4 -2
- package/third_party/ffmpeg_prebuilt/ANDROID_RELEASE_TAG +1 -0
- package/third_party/libarchive_prebuilt/ANDROID_RELEASE_TAG +1 -0
- package/third_party/libarchive_prebuilt/IOS_RELEASE_TAG +1 -0
- package/third_party/sherpa-onnx-prebuilt/ANDROID_RELEASE_TAG +1 -0
- package/third_party/sherpa-onnx-prebuilt/IOS_RELEASE_TAG +1 -0
- package/android/src/main/cpp/include/sherpa-onnx/c-api/c-api.h +0 -1918
- package/android/src/main/cpp/include/sherpa-onnx/c-api/cxx-api.h +0 -841
- package/android/src/main/cpp/jni/sherpa-onnx-model-detect.cpp +0 -541
- package/android/src/main/cpp/jni/sherpa-onnx-stt-jni.cpp +0 -336
- package/android/src/main/cpp/jni/sherpa-onnx-stt-wrapper.cpp +0 -222
- package/android/src/main/cpp/jni/sherpa-onnx-stt-wrapper.h +0 -68
- package/android/src/main/cpp/jni/sherpa-onnx-tts-jni.cpp +0 -823
- package/android/src/main/cpp/jni/sherpa-onnx-tts-wrapper.cpp +0 -387
- package/android/src/main/cpp/jni/sherpa-onnx-tts-wrapper.h +0 -147
- package/ios/Frameworks/sherpa_onnx.xcframework.zip +0 -0
- package/ios/include/sherpa-onnx/c-api/c-api.h +0 -1918
- package/ios/include/sherpa-onnx/c-api/cxx-api.h +0 -841
- package/ios/sherpa-onnx-model-detect.mm +0 -441
- package/ios/sherpa-onnx-stt-wrapper.h +0 -48
- package/ios/sherpa-onnx-stt-wrapper.mm +0 -201
- package/scripts/copy-headers.js +0 -184
- package/scripts/setup-assets.js +0 -323
|
@@ -2,17 +2,11 @@ import type { ModelPathConfig } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Utility functions for model path handling
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
* Predefined model identifiers
|
|
7
|
-
*/
|
|
8
|
-
export declare const MODELS: {
|
|
9
|
-
readonly ZIPFORMER_EN: "sherpa-onnx-zipformer-small-en";
|
|
10
|
-
readonly PARAFORMER_ZH: "sherpa-onnx-paraformer-zh-small";
|
|
11
|
-
};
|
|
12
|
-
export type ModelId = (typeof MODELS)[keyof typeof MODELS];
|
|
13
5
|
/**
|
|
14
6
|
* Get the default model directory path for the current platform.
|
|
15
|
-
* This is a
|
|
7
|
+
* This is a logical name (e.g. `'Documents/models'` on iOS), not an absolute path.
|
|
8
|
+
* On iOS, when using file-based models without PAD, pass an absolute base path to
|
|
9
|
+
* `getFileModelPath` instead (e.g. `DocumentDirectoryPath + '/models'` from react-native-fs).
|
|
16
10
|
*
|
|
17
11
|
* @returns Platform-specific default path
|
|
18
12
|
*/
|
|
@@ -29,7 +23,9 @@ export declare function assetModelPath(assetPath: string): ModelPathConfig;
|
|
|
29
23
|
* Create a model path configuration for file system models.
|
|
30
24
|
* Use this when models are downloaded or stored in file system.
|
|
31
25
|
*
|
|
32
|
-
* @param filePath - Absolute path to model directory
|
|
26
|
+
* @param filePath - Absolute path to model directory. On iOS, use an absolute path
|
|
27
|
+
* (e.g. from react-native-fs: `DocumentDirectoryPath + '/models/' + modelName` when
|
|
28
|
+
* using getFileModelPath without PAD).
|
|
33
29
|
* @returns Model path configuration
|
|
34
30
|
*/
|
|
35
31
|
export declare function fileModelPath(filePath: string): ModelPathConfig;
|
|
@@ -46,10 +42,10 @@ export declare function autoModelPath(path: string): ModelPathConfig;
|
|
|
46
42
|
* This handles different path types (asset, file, auto) and returns
|
|
47
43
|
* a platform-specific absolute path that can be used by native code.
|
|
48
44
|
*
|
|
49
|
-
* @param config - Model path configuration
|
|
45
|
+
* @param config - Model path configuration
|
|
50
46
|
* @returns Promise resolving to absolute path usable by native code
|
|
51
47
|
*/
|
|
52
|
-
export declare function resolveModelPath(config: ModelPathConfig
|
|
48
|
+
export declare function resolveModelPath(config: ModelPathConfig): Promise<string>;
|
|
53
49
|
/**
|
|
54
50
|
* List all model folders in the assets/models directory.
|
|
55
51
|
* Scans the platform-specific model directory and returns folder names.
|
|
@@ -71,7 +67,7 @@ export declare function resolveModelPath(config: ModelPathConfig | string): Prom
|
|
|
71
67
|
* // Initialize each model to detect types
|
|
72
68
|
* for (const model of models) {
|
|
73
69
|
* const path = await resolveModelPath({ type: 'asset', path: `models/${model.folder}` });
|
|
74
|
-
* const result = await
|
|
70
|
+
* const result = await initializeStt(path);
|
|
75
71
|
* if (result.success) {
|
|
76
72
|
* console.log(`Found models in ${model.folder}:`, result.detectedModels);
|
|
77
73
|
* }
|
|
@@ -82,4 +78,23 @@ export declare function listAssetModels(): Promise<Array<{
|
|
|
82
78
|
folder: string;
|
|
83
79
|
hint: 'stt' | 'tts' | 'unknown';
|
|
84
80
|
}>>;
|
|
81
|
+
/**
|
|
82
|
+
* List model folders under a specific filesystem path.
|
|
83
|
+
* When recursive is true, returns relative folder paths under the base path.
|
|
84
|
+
*/
|
|
85
|
+
export declare function listModelsAtPath(path: string, recursive?: boolean): Promise<Array<{
|
|
86
|
+
folder: string;
|
|
87
|
+
hint: 'stt' | 'tts' | 'unknown';
|
|
88
|
+
}>>;
|
|
89
|
+
/**
|
|
90
|
+
* **Play Asset Delivery (PAD):** Returns the path to the models directory inside an
|
|
91
|
+
* Android asset pack, or null if the pack is not available.
|
|
92
|
+
* Use this to list and load models delivered via PAD (e.g. pack "sherpa_models").
|
|
93
|
+
* On iOS returns null.
|
|
94
|
+
*/
|
|
95
|
+
export declare function getAssetPackPath(packName: string): Promise<string | null>;
|
|
96
|
+
/**
|
|
97
|
+
* Alias for {@link getAssetPackPath}. Use for PAD (Play Asset Delivery) model discovery.
|
|
98
|
+
*/
|
|
99
|
+
export declare const getPlayAssetDeliveryModelsPath: typeof getAssetPackPath;
|
|
85
100
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C;;GAEG;AAEH;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAQ5C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAKjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAK/D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAK3D;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAC9C,KAAK,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,CAAA;CAAE,CAAC,CAC3D,CAEA;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,SAAS,UAAQ,GAChB,OAAO,CAAC,KAAK,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,CAAA;CAAE,CAAC,CAAC,CAErE;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAExB;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,yBAAmB,CAAC"}
|
|
@@ -10,15 +10,16 @@
|
|
|
10
10
|
* // Future usage:
|
|
11
11
|
* import { initializeVAD, detectVoiceActivity } from 'react-native-sherpa-onnx/vad';
|
|
12
12
|
*
|
|
13
|
-
* await initializeVAD({ modelPath: 'models/vad-model' });
|
|
13
|
+
* await initializeVAD({ modelPath: { type: 'auto', path: 'models/vad-model' } });
|
|
14
14
|
* const segments = await detectVoiceActivity('path/to/audio.wav');
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
+
import type { ModelPathConfig } from '../types';
|
|
17
18
|
/**
|
|
18
19
|
* VAD initialization options (placeholder)
|
|
19
20
|
*/
|
|
20
21
|
export interface VADInitializeOptions {
|
|
21
|
-
modelPath:
|
|
22
|
+
modelPath: ModelPathConfig;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Voice activity segment
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/vad/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/vad/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,eAAe,CAAC;CAE5B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CAEb;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,YAAY,EAAE,CAAC,CAIzB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAIzC"}
|
package/package.json
CHANGED
|
@@ -1,222 +1,250 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-native-sherpa-onnx",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Offline Speech-to-text, text-to-speech, speaker diarization, speech enhancement, source separation, and VAD with sherpa-onnx for React NativeSpeech-to-Text with sherpa-onnx for React Native",
|
|
5
|
-
"main": "./lib/module/index.js",
|
|
6
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"source": "./src/index.tsx",
|
|
10
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
-
"default": "./lib/module/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./stt": {
|
|
14
|
-
"source": "./src/stt/index.ts",
|
|
15
|
-
"types": "./lib/typescript/src/stt/index.d.ts",
|
|
16
|
-
"default": "./lib/module/stt/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./tts": {
|
|
19
|
-
"source": "./src/tts/index.ts",
|
|
20
|
-
"types": "./lib/typescript/src/tts/index.d.ts",
|
|
21
|
-
"default": "./lib/module/tts/index.js"
|
|
22
|
-
},
|
|
23
|
-
"./vad": {
|
|
24
|
-
"source": "./src/vad/index.ts",
|
|
25
|
-
"types": "./lib/typescript/src/vad/index.d.ts",
|
|
26
|
-
"default": "./lib/module/vad/index.js"
|
|
27
|
-
},
|
|
28
|
-
"./diarization": {
|
|
29
|
-
"source": "./src/diarization/index.ts",
|
|
30
|
-
"types": "./lib/typescript/src/diarization/index.d.ts",
|
|
31
|
-
"default": "./lib/module/diarization/index.js"
|
|
32
|
-
},
|
|
33
|
-
"./enhancement": {
|
|
34
|
-
"source": "./src/enhancement/index.ts",
|
|
35
|
-
"types": "./lib/typescript/src/enhancement/index.d.ts",
|
|
36
|
-
"default": "./lib/module/enhancement/index.js"
|
|
37
|
-
},
|
|
38
|
-
"./separation": {
|
|
39
|
-
"source": "./src/separation/index.ts",
|
|
40
|
-
"types": "./lib/typescript/src/separation/index.d.ts",
|
|
41
|
-
"default": "./lib/module/separation/index.js"
|
|
42
|
-
},
|
|
43
|
-
"./
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
"ios",
|
|
92
|
-
"android"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
"
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
"
|
|
221
|
-
|
|
222
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-sherpa-onnx",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Offline Speech-to-text, text-to-speech, speaker diarization, speech enhancement, source separation, and VAD with sherpa-onnx for React NativeSpeech-to-Text with sherpa-onnx for React Native",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./stt": {
|
|
14
|
+
"source": "./src/stt/index.ts",
|
|
15
|
+
"types": "./lib/typescript/src/stt/index.d.ts",
|
|
16
|
+
"default": "./lib/module/stt/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./tts": {
|
|
19
|
+
"source": "./src/tts/index.ts",
|
|
20
|
+
"types": "./lib/typescript/src/tts/index.d.ts",
|
|
21
|
+
"default": "./lib/module/tts/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./vad": {
|
|
24
|
+
"source": "./src/vad/index.ts",
|
|
25
|
+
"types": "./lib/typescript/src/vad/index.d.ts",
|
|
26
|
+
"default": "./lib/module/vad/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./diarization": {
|
|
29
|
+
"source": "./src/diarization/index.ts",
|
|
30
|
+
"types": "./lib/typescript/src/diarization/index.d.ts",
|
|
31
|
+
"default": "./lib/module/diarization/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./enhancement": {
|
|
34
|
+
"source": "./src/enhancement/index.ts",
|
|
35
|
+
"types": "./lib/typescript/src/enhancement/index.d.ts",
|
|
36
|
+
"default": "./lib/module/enhancement/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./separation": {
|
|
39
|
+
"source": "./src/separation/index.ts",
|
|
40
|
+
"types": "./lib/typescript/src/separation/index.d.ts",
|
|
41
|
+
"default": "./lib/module/separation/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./download": {
|
|
44
|
+
"source": "./src/download/index.ts",
|
|
45
|
+
"types": "./lib/typescript/src/download/index.d.ts",
|
|
46
|
+
"default": "./lib/module/download/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./audio": {
|
|
49
|
+
"source": "./src/audio/index.ts",
|
|
50
|
+
"types": "./lib/typescript/src/audio/index.d.ts",
|
|
51
|
+
"default": "./lib/module/audio/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./package.json": "./package.json"
|
|
54
|
+
},
|
|
55
|
+
"files": [
|
|
56
|
+
"src",
|
|
57
|
+
"lib",
|
|
58
|
+
"android",
|
|
59
|
+
"ios",
|
|
60
|
+
"scripts/**",
|
|
61
|
+
"scripts/**/*",
|
|
62
|
+
"cpp",
|
|
63
|
+
"*.podspec",
|
|
64
|
+
"react-native.config.js",
|
|
65
|
+
"!third_party",
|
|
66
|
+
"!third_party/**",
|
|
67
|
+
"third_party/sherpa-onnx-prebuilt/IOS_RELEASE_TAG",
|
|
68
|
+
"third_party/sherpa-onnx-prebuilt/ANDROID_RELEASE_TAG",
|
|
69
|
+
"third_party/ffmpeg_prebuilt/ANDROID_RELEASE_TAG",
|
|
70
|
+
"third_party/libarchive_prebuilt/IOS_RELEASE_TAG",
|
|
71
|
+
"third_party/libarchive_prebuilt/ANDROID_RELEASE_TAG",
|
|
72
|
+
"!ios/build",
|
|
73
|
+
"!android/build",
|
|
74
|
+
"!android/gradle",
|
|
75
|
+
"!android/gradlew",
|
|
76
|
+
"!android/gradlew.bat",
|
|
77
|
+
"!android/local.properties",
|
|
78
|
+
"!**/__tests__",
|
|
79
|
+
"!**/__fixtures__",
|
|
80
|
+
"!**/__mocks__",
|
|
81
|
+
"!**/.*",
|
|
82
|
+
"!./third_party/sherpa-onnx",
|
|
83
|
+
"!./third_party/sherpa-onnx/**",
|
|
84
|
+
"!./third_party/ffmpeg",
|
|
85
|
+
"!./third_party/ffmpeg/**",
|
|
86
|
+
"!ios/Frameworks",
|
|
87
|
+
"!ios/Frameworks/**",
|
|
88
|
+
"!ios/Downloads",
|
|
89
|
+
"!ios/Downloads/**",
|
|
90
|
+
"!ios/patched_libarchive",
|
|
91
|
+
"!ios/patched_libarchive/**",
|
|
92
|
+
"!android/src/main/jniLibs",
|
|
93
|
+
"!android/src/main/jniLibs/**",
|
|
94
|
+
"!android/src/main/cpp/include",
|
|
95
|
+
"!android/src/main/cpp/include/**"
|
|
96
|
+
],
|
|
97
|
+
"scripts": {
|
|
98
|
+
"example": "yarn workspace react-native-sherpa-onnx-example",
|
|
99
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
100
|
+
"download-ios-framework": "bash scripts/setup-ios-framework.sh",
|
|
101
|
+
"prepare": "bob build",
|
|
102
|
+
"typecheck": "tsc",
|
|
103
|
+
"lint": "eslint --ignore-pattern \"sherpa-onnx/**\" \"**/*.{js,ts,tsx}\"",
|
|
104
|
+
"lint:fix": "eslint --fix --ignore-pattern \"sherpa-onnx/**\" \"**/*.{js,ts,tsx}\"",
|
|
105
|
+
"prettier": "npx prettier --write \"src/**/*.{js,ts,tsx}\" \"example/src/**/*.{js,ts,tsx}\" \"scripts/**/*.{js,ts,tsx}\"",
|
|
106
|
+
"test": "jest",
|
|
107
|
+
"verdaccio:start": "VERDACCIO_BODY_SIZE_LIMIT=100mb verdaccio --config verdaccio.config.yaml",
|
|
108
|
+
"registry:local": "node scripts/switch-registry.js local",
|
|
109
|
+
"registry:public": "node scripts/switch-registry.js public",
|
|
110
|
+
"release": "release-it"
|
|
111
|
+
},
|
|
112
|
+
"keywords": [
|
|
113
|
+
"react-native",
|
|
114
|
+
"ios",
|
|
115
|
+
"android"
|
|
116
|
+
],
|
|
117
|
+
"repository": {
|
|
118
|
+
"type": "git",
|
|
119
|
+
"url": "git+https://github.com/XDcobra/react-native-sherpa-onnx.git"
|
|
120
|
+
},
|
|
121
|
+
"author": "XDcobra <xdcobra11@gmail.com> (https://github.com/XDcobra)",
|
|
122
|
+
"license": "MIT",
|
|
123
|
+
"bugs": {
|
|
124
|
+
"url": "https://github.com/XDcobra/react-native-sherpa-onnx/issues"
|
|
125
|
+
},
|
|
126
|
+
"homepage": "https://github.com/XDcobra/react-native-sherpa-onnx#readme",
|
|
127
|
+
"publishConfig": {
|
|
128
|
+
"registry": "https://registry.npmjs.org/"
|
|
129
|
+
},
|
|
130
|
+
"devDependencies": {
|
|
131
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
132
|
+
"@dr.pogodin/react-native-fs": "^2.37.0",
|
|
133
|
+
"@eslint/compat": "^1.3.2",
|
|
134
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
135
|
+
"@eslint/js": "^9.35.0",
|
|
136
|
+
"@react-native-community/cli": "^20.1.1",
|
|
137
|
+
"@react-native/babel-preset": "0.83.0",
|
|
138
|
+
"@react-native/eslint-config": "0.83.0",
|
|
139
|
+
"@release-it/conventional-changelog": "^10.0.5",
|
|
140
|
+
"@types/jest": "^29.5.14",
|
|
141
|
+
"@types/react": "^19.2.0",
|
|
142
|
+
"commitlint": "^19.8.1",
|
|
143
|
+
"del-cli": "^6.0.0",
|
|
144
|
+
"eslint": "^9.35.0",
|
|
145
|
+
"eslint-config-prettier": "^10.1.8",
|
|
146
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
147
|
+
"jest": "^29.7.0",
|
|
148
|
+
"lefthook": "^2.0.3",
|
|
149
|
+
"prettier": "^2.8.8",
|
|
150
|
+
"react": "19.2.0",
|
|
151
|
+
"react-native": "0.83.0",
|
|
152
|
+
"react-native-builder-bob": "^0.40.13",
|
|
153
|
+
"release-it": "^19.2.4",
|
|
154
|
+
"turbo": "^2.5.6",
|
|
155
|
+
"typescript": "^5.9.2"
|
|
156
|
+
},
|
|
157
|
+
"peerDependencies": {
|
|
158
|
+
"@dr.pogodin/react-native-fs": "*",
|
|
159
|
+
"react": "*",
|
|
160
|
+
"react-native": "*"
|
|
161
|
+
},
|
|
162
|
+
"workspaces": [
|
|
163
|
+
"example"
|
|
164
|
+
],
|
|
165
|
+
"packageManager": "yarn@4.11.0",
|
|
166
|
+
"react-native-builder-bob": {
|
|
167
|
+
"source": "src",
|
|
168
|
+
"output": "lib",
|
|
169
|
+
"targets": [
|
|
170
|
+
[
|
|
171
|
+
"module",
|
|
172
|
+
{
|
|
173
|
+
"esm": true
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
[
|
|
177
|
+
"typescript",
|
|
178
|
+
{
|
|
179
|
+
"project": "tsconfig.build.json"
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"codegenConfig": {
|
|
185
|
+
"name": "SherpaOnnxSpec",
|
|
186
|
+
"type": "modules",
|
|
187
|
+
"jsSrcsDir": "src",
|
|
188
|
+
"includesGeneratedCode": false,
|
|
189
|
+
"android": {
|
|
190
|
+
"javaPackageName": "com.sherpaonnx"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"prettier": {
|
|
194
|
+
"quoteProps": "consistent",
|
|
195
|
+
"singleQuote": true,
|
|
196
|
+
"tabWidth": 2,
|
|
197
|
+
"trailingComma": "es5",
|
|
198
|
+
"useTabs": false
|
|
199
|
+
},
|
|
200
|
+
"jest": {
|
|
201
|
+
"preset": "react-native",
|
|
202
|
+
"modulePathIgnorePatterns": [
|
|
203
|
+
"<rootDir>/example/node_modules",
|
|
204
|
+
"<rootDir>/lib/"
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
"commitlint": {
|
|
208
|
+
"extends": [
|
|
209
|
+
"@commitlint/config-conventional"
|
|
210
|
+
],
|
|
211
|
+
"rules": {
|
|
212
|
+
"header-max-length": [
|
|
213
|
+
2,
|
|
214
|
+
"always",
|
|
215
|
+
300
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"release-it": {
|
|
220
|
+
"git": {
|
|
221
|
+
"commitMessage": "chore: release ${version}",
|
|
222
|
+
"tagName": "v${version}"
|
|
223
|
+
},
|
|
224
|
+
"npm": {
|
|
225
|
+
"publish": true
|
|
226
|
+
},
|
|
227
|
+
"github": {
|
|
228
|
+
"release": false
|
|
229
|
+
},
|
|
230
|
+
"plugins": {
|
|
231
|
+
"@release-it/conventional-changelog": {
|
|
232
|
+
"preset": {
|
|
233
|
+
"name": "angular"
|
|
234
|
+
},
|
|
235
|
+
"infile": "CHANGELOG.md"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"create-react-native-library": {
|
|
240
|
+
"type": "turbo-module",
|
|
241
|
+
"languages": "kotlin-objc",
|
|
242
|
+
"tools": [
|
|
243
|
+
"eslint",
|
|
244
|
+
"jest",
|
|
245
|
+
"lefthook",
|
|
246
|
+
"release-it"
|
|
247
|
+
],
|
|
248
|
+
"version": "0.57.0"
|
|
249
|
+
}
|
|
250
|
+
}
|