csukuangfj
commited on
Commit
•
404fa6a
1
Parent(s):
bf46307
update model
Browse files- sherpa-onnx-vad.js +6 -1
- sherpa-onnx-wasm-main-vad.js +0 -0
- sherpa-onnx-wasm-main-vad.wasm +2 -2
sherpa-onnx-vad.js
CHANGED
@@ -19,7 +19,7 @@ function initSherpaOnnxSileroVadModelConfig(config, Module) {
|
|
19 |
|
20 |
const buffer = Module._malloc(n);
|
21 |
|
22 |
-
const len =
|
23 |
const ptr = Module._malloc(len);
|
24 |
|
25 |
Module.stringToUTF8(config.model || '', buffer, modelLen);
|
@@ -40,6 +40,9 @@ function initSherpaOnnxSileroVadModelConfig(config, Module) {
|
|
40 |
Module.setValue(ptr + offset, config.windowSize || 512, 'i32');
|
41 |
offset += 4;
|
42 |
|
|
|
|
|
|
|
43 |
return {
|
44 |
buffer: buffer, ptr: ptr, len: len,
|
45 |
}
|
@@ -53,6 +56,7 @@ function initSherpaOnnxVadModelConfig(config, Module) {
|
|
53 |
minSilenceDuration: 0.50,
|
54 |
minSpeechDuration: 0.25,
|
55 |
windowSize: 512,
|
|
|
56 |
};
|
57 |
}
|
58 |
|
@@ -93,6 +97,7 @@ function createVad(Module, myConfig) {
|
|
93 |
threshold: 0.50,
|
94 |
minSilenceDuration: 0.50,
|
95 |
minSpeechDuration: 0.25,
|
|
|
96 |
windowSize: 512,
|
97 |
};
|
98 |
|
|
|
19 |
|
20 |
const buffer = Module._malloc(n);
|
21 |
|
22 |
+
const len = 6 * 4;
|
23 |
const ptr = Module._malloc(len);
|
24 |
|
25 |
Module.stringToUTF8(config.model || '', buffer, modelLen);
|
|
|
40 |
Module.setValue(ptr + offset, config.windowSize || 512, 'i32');
|
41 |
offset += 4;
|
42 |
|
43 |
+
Module.setValue(ptr + offset, config.maxSpeechDuration || 20, 'float');
|
44 |
+
offset += 4;
|
45 |
+
|
46 |
return {
|
47 |
buffer: buffer, ptr: ptr, len: len,
|
48 |
}
|
|
|
56 |
minSilenceDuration: 0.50,
|
57 |
minSpeechDuration: 0.25,
|
58 |
windowSize: 512,
|
59 |
+
maxSpeechDuration: 20,
|
60 |
};
|
61 |
}
|
62 |
|
|
|
97 |
threshold: 0.50,
|
98 |
minSilenceDuration: 0.50,
|
99 |
minSpeechDuration: 0.25,
|
100 |
+
maxSpeechDuration: 20,
|
101 |
windowSize: 512,
|
102 |
};
|
103 |
|
sherpa-onnx-wasm-main-vad.js
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
sherpa-onnx-wasm-main-vad.wasm
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e583d7ab1beb92dd219f94c16c8bd104788f6847993d4ca028fa4b3b0a2da43
|
3 |
+
size 10336118
|