@eka-care/ekascribe-ts-sdk 1.5.36 → 1.5.38

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.
@@ -238,15 +238,21 @@ class VadWebClient {
238
238
  const audioFileManager = EkaScribeStore.audioFileManagerInstance;
239
239
  const audioBuffer = EkaScribeStore.audioBufferInstance;
240
240
  this.is_vad_loading = true;
241
- const vadFrameProcessedCallback = EkaScribeStore.vadFrameProcessedCallback;
242
241
  const vad = await MicVAD.new({
243
242
  frameSamples: this.frame_size,
244
243
  preSpeechPadFrames: this.speech_pad_frames,
245
244
  onFrameProcessed: (prob, frames) => {
246
245
  console.log(frames, 'frames in vad web');
246
+ // Get callback dynamically to ensure it's always up to date
247
+ const vadFrameProcessedCallback = EkaScribeStore.vadFrameProcessedCallback;
248
+ console.log('VAD callback exists:', !!vadFrameProcessedCallback, 'Recording started:', this.recording_started);
247
249
  if (vadFrameProcessedCallback) {
248
250
  vadFrameProcessedCallback({ probabilities: prob, frame: frames });
249
251
  }
252
+ // Only process frames internally when recording is active
253
+ if (!this.recording_started) {
254
+ return;
255
+ }
250
256
  audioFileManager?.incrementTotalRawSamples(frames);
251
257
  audioBuffer?.append(frames);
252
258
  // Check if audio chunk needs to be clipped
@@ -146,6 +146,7 @@ class EkaScribeStore {
146
146
  this._userSpeechCallback = null;
147
147
  this._eventCallback = null;
148
148
  this._vadFramesCallback = null;
149
+ this._vadFrameProcessedCallback = null;
149
150
  }
150
151
  }
151
152
  export default EkaScribeStore.getInstance();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "1.5.36",
3
+ "version": "1.5.38",
4
4
  "main": "dist/index.js",
5
5
  "repository": "git@github.com:eka-care/eka-js-sdk.git",
6
6
  "author": "Sanikagoyal28 <sanikagoyal9@gmail.com>",