-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Bug Description
Description
The audio_mixing parameter in RoomCompositeEgressRequest is not being applied by the egress service. When setting audio_mixing=DUAL_CHANNEL_AGENT or audio_mixing=DUAL_CHANNEL_ALTERNATE, the resulting recording still contains identical mixed audio in both L and R channels instead of separating the audio streams.
Code
from livekit.protocol.egress import (
RoomCompositeEgressRequest,
EncodedFileOutput,
EncodedFileType,
AudioMixing,
)
req = RoomCompositeEgressRequest(
room_name=room_name,
layout="speaker",
audio_only=True,
audio_mixing=AudioMixing.DUAL_CHANNEL_AGENT,
file_outputs=[file_output],
)
info = await api.egress.start_room_composite_egress(req)
Evidence
The server acknowledges receiving the audio_mixing parameter correctly.
Waveform analysis of the output file shows both channels contain identical audio:
- Top (Red) = Left channel
- Bottom (Green) = Right channel
- Both waveforms are identical, proving no channel separation occurred
Expected Behavior
According to the documentation and protocol definition:
DUAL_CHANNEL_AGENT:
- Left channel: Agent audio only
- Right channel: All other participants' audio
DUAL_CHANNEL_ALTERNATE:
- Each new audio track alternates between left and right channels
Actual Behavior
Both L and R channels contain the same mixed audio (all participants mixed together), regardless of which AudioMixing mode is set.
Additional Context
- Tested with both
AudioMixing.DUAL_CHANNEL_AGENTandAudioMixing.DUAL_CHANNEL_ALTERNATE- same issue - The
EgressInforesponse confirms the server receivedaudio_mixing=1, so the parameter is being transmitted correctly - The agent's
ParticipantKindis correctly set to4(AGENT) - The implementation in pkg/pipeline/builder/audio.go checks
ParticipantKind == ParticipantAgentto determine channel routing
Reproduction Steps
1. Start a room composite egress with `audio_mixing=DUAL_CHANNEL_AGENT` and `audio_only=True`
2. Have an agent (ParticipantKind=AGENT) and a regular participant in the room
3. Both participants speak
4. Stop the egress and examine the resulting audio fileOperating System
macOS
Models Used
No response
Package Versions
deployed in livekit cloud
livekit-agents: 1.3.10Session/Room/Call IDs
No response
Proposed Solution
Additional Context
No response
Screenshots and Recordings
No response