@eka-care/ekascribe-ts-sdk 2.0.52 → 2.0.54
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/dist/index.d.ts +1 -0
- package/dist/index.mjs +7 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -11456,7 +11456,7 @@ class AudioBufferManager {
|
|
|
11456
11456
|
* @returns The duration of audio currently in the buffer in seconds
|
|
11457
11457
|
*/
|
|
11458
11458
|
getDurationInSeconds() {
|
|
11459
|
-
return this.currentSampleLength / this.samplingRate;
|
|
11459
|
+
return Math.floor(this.currentSampleLength / this.samplingRate);
|
|
11460
11460
|
}
|
|
11461
11461
|
/**
|
|
11462
11462
|
* Expand the buffer by allocating a new block of memory
|
|
@@ -53036,10 +53036,14 @@ class VadWebClient {
|
|
|
53036
53036
|
frameSamples: this.frame_size,
|
|
53037
53037
|
preSpeechPadFrames: this.speech_pad_frames,
|
|
53038
53038
|
onFrameProcessed: (u, m) => {
|
|
53039
|
+
s?.incrementTotalRawSamples(m), n?.append(m);
|
|
53039
53040
|
const y = EkaScribeStore$1.vadFrameProcessedCallback;
|
|
53040
|
-
if (y
|
|
53041
|
+
if (y) {
|
|
53042
|
+
const o = n?.getDurationInSeconds() || 0;
|
|
53043
|
+
y({ probabilities: u, frame: m, duration: o });
|
|
53044
|
+
}
|
|
53045
|
+
if (!this.recording_started)
|
|
53041
53046
|
return;
|
|
53042
|
-
s?.incrementTotalRawSamples(m), n?.append(m);
|
|
53043
53047
|
const { isSpeech: l } = u;
|
|
53044
53048
|
let p = 0;
|
|
53045
53049
|
if (l >= 0.5 && (p = 1), this.checkNoSpeech(p), this.processVadFrame(p)[0]) {
|