react-native-sherpa-onnx 0.1.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/LICENSE +20 -0
- package/README.md +402 -0
- package/SherpaOnnx.podspec +84 -0
- package/android/build.gradle +193 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/CMakeLists.txt +121 -0
- package/android/src/main/cpp/include/sherpa-onnx/c-api/c-api.h +1918 -0
- package/android/src/main/cpp/include/sherpa-onnx/c-api/cxx-api.h +841 -0
- package/android/src/main/cpp/jni/sherpa-onnx-jni.cpp +129 -0
- package/android/src/main/cpp/jni/sherpa-onnx-wrapper.cpp +649 -0
- package/android/src/main/cpp/jni/sherpa-onnx-wrapper.h +56 -0
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxModule.kt +316 -0
- package/android/src/main/java/com/sherpaonnx/SherpaOnnxPackage.kt +33 -0
- package/ios/Frameworks/sherpa_onnx.xcframework.zip +0 -0
- package/ios/SherpaOnnx.h +5 -0
- package/ios/SherpaOnnx.mm +293 -0
- package/ios/SherpaOnnx.xcconfig +19 -0
- package/ios/include/sherpa-onnx/c-api/c-api.h +1918 -0
- package/ios/include/sherpa-onnx/c-api/cxx-api.h +841 -0
- package/ios/sherpa-onnx-wrapper.h +57 -0
- package/ios/sherpa-onnx-wrapper.mm +432 -0
- package/lib/module/NativeSherpaOnnx.js +5 -0
- package/lib/module/NativeSherpaOnnx.js.map +1 -0
- package/lib/module/diarization/index.js +54 -0
- package/lib/module/diarization/index.js.map +1 -0
- package/lib/module/enhancement/index.js +54 -0
- package/lib/module/enhancement/index.js.map +1 -0
- package/lib/module/index.js +25 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/separation/index.js +54 -0
- package/lib/module/separation/index.js.map +1 -0
- package/lib/module/stt/index.js +79 -0
- package/lib/module/stt/index.js.map +1 -0
- package/lib/module/stt/types.js +4 -0
- package/lib/module/stt/types.js.map +1 -0
- package/lib/module/tts/index.js +54 -0
- package/lib/module/tts/index.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +93 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/vad/index.js +54 -0
- package/lib/module/vad/index.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeSherpaOnnx.d.ts +39 -0
- package/lib/typescript/src/NativeSherpaOnnx.d.ts.map +1 -0
- package/lib/typescript/src/diarization/index.d.ts +49 -0
- package/lib/typescript/src/diarization/index.d.ts.map +1 -0
- package/lib/typescript/src/enhancement/index.d.ts +47 -0
- package/lib/typescript/src/enhancement/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +9 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/separation/index.d.ts +48 -0
- package/lib/typescript/src/separation/index.d.ts.map +1 -0
- package/lib/typescript/src/stt/index.d.ts +53 -0
- package/lib/typescript/src/stt/index.d.ts.map +1 -0
- package/lib/typescript/src/stt/types.d.ts +39 -0
- package/lib/typescript/src/stt/types.d.ts.map +1 -0
- package/lib/typescript/src/tts/index.d.ts +47 -0
- package/lib/typescript/src/tts/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +59 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +53 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/vad/index.d.ts +48 -0
- package/lib/typescript/src/vad/index.d.ts.map +1 -0
- package/package.json +221 -0
- package/scripts/copy-headers.js +184 -0
- package/scripts/setup-assets.js +323 -0
- package/scripts/setup-ios-framework.sh +282 -0
- package/scripts/switch-registry.js +75 -0
- package/src/NativeSherpaOnnx.ts +44 -0
- package/src/diarization/index.ts +69 -0
- package/src/enhancement/index.ts +67 -0
- package/src/index.tsx +30 -0
- package/src/separation/index.ts +68 -0
- package/src/stt/index.ts +83 -0
- package/src/stt/types.ts +42 -0
- package/src/tts/index.ts +67 -0
- package/src/types.ts +73 -0
- package/src/utils.ts +97 -0
- package/src/vad/index.ts +70 -0
package/src/vad/index.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice Activity Detection (VAD) feature module
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This feature is not yet implemented. This module serves as a placeholder
|
|
6
|
+
* for future VAD functionality.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Future usage:
|
|
11
|
+
* import { initializeVAD, detectVoiceActivity } from 'react-native-sherpa-onnx/vad';
|
|
12
|
+
*
|
|
13
|
+
* await initializeVAD({ modelPath: 'models/vad-model' });
|
|
14
|
+
* const segments = await detectVoiceActivity('path/to/audio.wav');
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* VAD initialization options (placeholder)
|
|
20
|
+
*/
|
|
21
|
+
export interface VADInitializeOptions {
|
|
22
|
+
modelPath: string;
|
|
23
|
+
// Additional VAD-specific options will be added here
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Voice activity segment
|
|
28
|
+
*/
|
|
29
|
+
export interface VoiceSegment {
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
// Additional segment fields will be added here
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Initialize Voice Activity Detection (VAD) with model directory.
|
|
37
|
+
*
|
|
38
|
+
* @throws {Error} Not yet implemented
|
|
39
|
+
*/
|
|
40
|
+
export async function initializeVAD(
|
|
41
|
+
_options: VADInitializeOptions
|
|
42
|
+
): Promise<void> {
|
|
43
|
+
throw new Error(
|
|
44
|
+
'VAD feature is not yet implemented. This is a placeholder module.'
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Detect voice activity in an audio file.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error} Not yet implemented
|
|
52
|
+
*/
|
|
53
|
+
export function detectVoiceActivity(
|
|
54
|
+
_filePath: string
|
|
55
|
+
): Promise<VoiceSegment[]> {
|
|
56
|
+
throw new Error(
|
|
57
|
+
'VAD feature is not yet implemented. This is a placeholder module.'
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Release VAD resources.
|
|
63
|
+
*
|
|
64
|
+
* @throws {Error} Not yet implemented
|
|
65
|
+
*/
|
|
66
|
+
export function unloadVAD(): Promise<void> {
|
|
67
|
+
throw new Error(
|
|
68
|
+
'VAD feature is not yet implemented. This is a placeholder module.'
|
|
69
|
+
);
|
|
70
|
+
}
|