File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @livekit/agents " : patch
3+ ---
4+
5+ Ensure input stream is only tee'd when it's actually being used
Original file line number Diff line number Diff line change @@ -500,16 +500,15 @@ export class AgentActivity implements RecognitionHooks {
500500 } ) ;
501501
502502 this . audioStreamId = this . audioStream . addInputStream ( audioStream ) ;
503- const [ realtimeAudioStream , recognitionAudioStream ] = this . audioStream . stream
504- . pipeThrough ( aecWarmupAudioFilter )
505- . tee ( ) ;
506503
507- if ( this . realtimeSession ) {
504+ if ( this . realtimeSession && this . audioRecognition ) {
505+ const [ realtimeAudioStream , recognitionAudioStream ] = this . audioStream . stream . tee ( ) ;
508506 this . realtimeSession . setInputAudioStream ( realtimeAudioStream ) ;
509- }
510-
511- if ( this . audioRecognition ) {
512507 this . audioRecognition . setInputAudioStream ( recognitionAudioStream ) ;
508+ } else if ( this . realtimeSession ) {
509+ this . realtimeSession . setInputAudioStream ( this . audioStream . stream ) ;
510+ } else if ( this . audioRecognition ) {
511+ this . audioRecognition . setInputAudioStream ( this . audioStream . stream ) ;
513512 }
514513 }
515514
You can’t perform that action at this time.
0 commit comments