csukuangfj
commited on
Commit
•
bf43fd8
1
Parent(s):
4fb778b
update model
Browse files
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-asr.js
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
sherpa-onnx-wasm-main-vad-asr.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:5eaae574bf39f2af021f27db9954b2093a48dd62e60b7f969cab0b672f5c1ed5
|
3 |
+
size 11386695
|