how to change participants audioLevel
# ask-ai
b
how to change participants audioLevel
t
Thanks for reaching out, Mohammed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It sounds like you want to adjust how loud a participant sounds. Do you mean changing client-side playback volume, or altering the audio at the source/server? • For client-side playback: set the audio track’s volume (0–1.0) when you subscribe/play it. This changes how loud you hear that participant without muting them. See track subscribing and playback. • To mute/unmute instead of changing level: toggle the track’s
muted
state on the publication. See tracks and publications. • For agent/tts audio (server-side): insert a processor in your TTS or realtime audio output node to scale volume before sending. See agent speech/audio and pipeline nodes/hooks. Which SDK are you using (JS, iOS, Android, Unity, etc.) and do you want code for playback volume or server-side processing? Sources: Rooms, participants, and tracks | LiveKit docs | Subscribing to tracks | LiveKit docs | Real-time audio and video in the Metaverse | Pipeline nodes and hooks | LiveKit docs | Agent speech and audio | LiveKit docs
b
iam using python sdk, i need to decrease users audio level
t
Thanks for clarifying you’re using the Python SDK and want to decrease users’ audio level. There are two practical paths: • Client playback (recommended): lower the subscribed track’s playback volume on the client UI (0.0–1.0). This is the simplest way to make a participant sound quieter for that listener. See subscribing and playback controls: docs. • Server/agent processing (Python): subscribe to the participant’s audio, read frames via an
AudioStream
, scale amplitudes down, and publish the processed audio back to the room as a new track (so all listeners hear it quieter). You’ll use raw track processing and your pipeline node to adjust gain. References: raw media tracks, agent speech/audio, nodes/hooks. Would you like a minimal Python snippet showing how to: • Wrap a subscribed track with
rtc.AudioStream
, attenuate frames, and republish; or • Adjust playback volume from your client (which frontend are you using)? Sources: Subscribing to tracks | LiveKit docs | Agent speech and audio | LiveKit docs | Pipeline nodes and hooks | LiveKit docs | Cartesia TTS plugin guide | LiveKit Docs | Managing participants | LiveKit docs
b
js
t
You’re on JS and want to lower a participant’s volume. Set the subscribed audio track’s playback volume (0–1.0) when you receive it:
Copy code
room.on(RoomEvent.TrackSubscribed, (track, publication, participant) => {
  if (track.kind === 'audio') {
    track.volume = 0.5; // 50% volume; range is 0.0–1.0
  }
});
You can also adjust later via the publication:
Copy code
const pub = remoteParticipant.getTrackPublication(Track.Source.Microphone);
pub?.track && (pub.track.volume = 0.3);
More on subscribing and playback controls: docs. Sources: Subscribing to tracks | LiveKit docs | Rooms, participants, and tracks | LiveKit docs | Real-time audio and video in the Metaverse | Agent speech and audio | LiveKit docs