diff --git a/package.json b/package.json index 9ea9a13..899c520 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rapidaai/react", - "version": "1.1.53", + "version": "1.1.54", "description": "An easy to use react client for building generative ai application using Rapida platform.", "repository": { "type": "git", diff --git a/src/agents/voice-agent.ts b/src/agents/voice-agent.ts index f806994..4e17c71 100644 --- a/src/agents/voice-agent.ts +++ b/src/agents/voice-agent.ts @@ -242,6 +242,9 @@ export class VoiceAgent extends Agent { private fadeOutAudio = (duration: number = 2) => { if (!this.output) return; + // Reset interrupt flag to prevent VAD from clearing audio due to previous WORD interrupt + this.output.worklet.port.postMessage({ type: "resetInterrupt" }); + const currentTime = this.output.context.currentTime; this.output.gain.gain.exponentialRampToValueAtTime( 0.0001, diff --git a/src/audio/audio-concat-processor.ts b/src/audio/audio-concat-processor.ts index ce11e11..fae2132 100644 --- a/src/audio/audio-concat-processor.ts +++ b/src/audio/audio-concat-processor.ts @@ -51,6 +51,9 @@ class AudioConcatProcessor extends AudioWorkletProcessor { case "interrupt": this.wasInterrupted = true; break; + case "resetInterrupt": + this.wasInterrupted = false; + break; case "clearInterrupted": if (this.wasInterrupted) { this.wasInterrupted = false;