@layercode/js-sdk 2.3.2 → 2.4.0

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.
@@ -3698,8 +3698,8 @@ registerProcessor('audio_processor', AudioProcessor);
3698
3698
  _initializeVAD() {
3699
3699
  var _a;
3700
3700
  console.log('initializing VAD', { pushToTalkEnabled: this.pushToTalkEnabled, canInterrupt: this.canInterrupt, vadConfig: this.vadConfig });
3701
- // If we're in push to talk mode, we don't need to use the VAD model
3702
- if (this.pushToTalkEnabled) {
3701
+ // If we're in push to talk mode or mute mode, we don't need to use the VAD model
3702
+ if (this.pushToTalkEnabled || this.isMuted) {
3703
3703
  return;
3704
3704
  }
3705
3705
  // Check if VAD is disabled
@@ -3848,6 +3848,9 @@ registerProcessor('audio_processor', AudioProcessor);
3848
3848
  await this._clientInterruptAgentReplay();
3849
3849
  this._wsSend({ type: 'client.response.text', content: text });
3850
3850
  }
3851
+ async sendClientResponseData(data) {
3852
+ this._wsSend({ type: 'client.response.data', data: data });
3853
+ }
3851
3854
  /**
3852
3855
  * Handles incoming WebSocket messages
3853
3856
  * @param {MessageEvent} event - The WebSocket message event
@@ -4458,6 +4461,7 @@ registerProcessor('audio_processor', AudioProcessor);
4458
4461
  this.isMuted = true;
4459
4462
  console.log('Microphone muted');
4460
4463
  this.options.onMuteStateChange(true);
4464
+ this.stopVad();
4461
4465
  }
4462
4466
  }
4463
4467
  /**
@@ -4468,6 +4472,7 @@ registerProcessor('audio_processor', AudioProcessor);
4468
4472
  this.isMuted = false;
4469
4473
  console.log('Microphone unmuted');
4470
4474
  this.options.onMuteStateChange(false);
4475
+ this._initializeVAD();
4471
4476
  }
4472
4477
  }
4473
4478
  }