sherpa-onnx-node 1.0.26 → 1.0.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sherpa-onnx-node",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "Speech-to-text and text-to-speech using Next-gen Kaldi without internet connection",
5
5
  "main": "sherpa-onnx.js",
6
6
  "scripts": {
@@ -45,10 +45,10 @@
45
45
  },
46
46
  "homepage": "https://github.com/csukuangfj/sherpa-onnx#readme",
47
47
  "optionalDependencies": {
48
- "sherpa-onnx-darwin-arm64": "^1.0.26",
49
- "sherpa-onnx-darwin-x64": "^1.0.26",
50
- "sherpa-onnx-linux-x64": "^1.0.26",
51
- "sherpa-onnx-linux-arm64": "^1.0.26",
52
- "sherpa-onnx-win-x64": "^1.0.26"
48
+ "sherpa-onnx-darwin-arm64": "^1.0.28",
49
+ "sherpa-onnx-darwin-x64": "^1.0.28",
50
+ "sherpa-onnx-linux-x64": "^1.0.28",
51
+ "sherpa-onnx-linux-arm64": "^1.0.28",
52
+ "sherpa-onnx-win-x64": "^1.0.28"
53
53
  }
54
54
  }
@@ -18,9 +18,9 @@ class SpeakerEmbeddingExtractor {
18
18
  }
19
19
 
20
20
  // return a float32 array
21
- compute(stream) {
21
+ compute(stream, enableExternalBuffer = true) {
22
22
  return addon.speakerEmbeddingExtractorComputeEmbedding(
23
- this.handle, stream.handle);
23
+ this.handle, stream.handle, enableExternalBuffer);
24
24
  }
25
25
  }
26
26
 
package/vad.js CHANGED
@@ -11,8 +11,9 @@ class CircularBuffer {
11
11
  }
12
12
 
13
13
  // return a float32 array
14
- get(startIndex, n) {
15
- return addon.circularBufferGet(this.handle, startIndex, n);
14
+ get(startIndex, n, enableExternalBuffer = true) {
15
+ return addon.circularBufferGet(
16
+ this.handle, startIndex, n, enableExternalBuffer);
16
17
  }
17
18
 
18
19
  pop(n) {
@@ -48,23 +49,23 @@ config = {
48
49
  }
49
50
 
50
51
  acceptWaveform(samples) {
51
- addon.voiceActivityDetectorAcceptWaveform(this.handle, samples)
52
+ addon.voiceActivityDetectorAcceptWaveform(this.handle, samples);
52
53
  }
53
54
 
54
55
  isEmpty() {
55
- return addon.voiceActivityDetectorIsEmpty(this.handle)
56
+ return addon.voiceActivityDetectorIsEmpty(this.handle);
56
57
  }
57
58
 
58
59
  isDetected() {
59
- return addon.voiceActivityDetectorIsDetected(this.handle)
60
+ return addon.voiceActivityDetectorIsDetected(this.handle);
60
61
  }
61
62
 
62
63
  pop() {
63
- addon.voiceActivityDetectorPop(this.handle)
64
+ addon.voiceActivityDetectorPop(this.handle);
64
65
  }
65
66
 
66
67
  clear() {
67
- addon.VoiceActivityDetectorClearWrapper(this.handle)
68
+ addon.VoiceActivityDetectorClearWrapper(this.handle);
68
69
  }
69
70
 
70
71
  /*
@@ -73,12 +74,12 @@ config = {
73
74
  start: a int32
74
75
  }
75
76
  */
76
- front() {
77
- return addon.voiceActivityDetectorFront(this.handle)
77
+ front(enableExternalBuffer = true) {
78
+ return addon.voiceActivityDetectorFront(this.handle, enableExternalBuffer);
78
79
  }
79
80
 
80
81
  reset() {
81
- return addon.VoiceActivityDetectorResetWrapper(this.handle)
82
+ return addon.VoiceActivityDetectorResetWrapper(this.handle);
82
83
  }
83
84
  }
84
85