wide-salesmen-41212
11/18/2025, 11:46 AMtall-airline-16756
11/18/2025, 11:46 AMtall-airline-16756
11/18/2025, 11:47 AMroom.setMicrophoneMute(true) to mute your microphone audio locally, so you won’t hear it, but it will still be sent to others in the room. When you’re ready to unmute, just use room.setMicrophoneMute(false).
This approach lets you control your audio without affecting what others hear. If you have any questions or want me to walk you through the steps, I’m here to help!
Sources: src/room/track/LocalAudioTrack.ts | livekit-rtc/livekit/rtc/track.py | Sources/LiveKit/Track/Local/LocalAudioTrack.swift | Camera & microphone | LiveKit docs | livekit/src/room/track/mod.rswide-salesmen-41212
11/18/2025, 11:48 AMtall-airline-16756
11/18/2025, 11:50 AMawait room.localParticipant.setMicrophoneEnabled(false);
This will stop your audio from being sent to others and let them know you've muted yourself. When you're ready to unmute, just use await room.localParticipant.setMicrophoneEnabled(true);.
• Using `LocalAudioTrack`:
await localAudioTrack.mute();
This also pauses your audio transmission and notifies remote participants. To unmute, simply call await localAudioTrack.unmute();.
Both of these options will mute your audio for others in the room. If you're looking to mute audio just on your end without affecting what others hear, please feel free to reach out—I’m here to help you with that!
Sources: JavaScript/TypeScript SDK | livekit/livekit_composite | DeepWiki | Camera & microphone | LiveKit docs | Samples~/JSExample/JSPackage~/src/index.ts | Real-time audio and video in the Metaverse | src/room/track/LocalAudioTrack.tswide-salesmen-41212
11/18/2025, 11:54 AMtall-airline-16756
11/18/2025, 11:55 AMgetUserMedia, you can easily manage the local playback right at the HTML media element level—this way, your published stream stays unaffected:
• Using an HTML <audio> element:
// Attach the local audio track to an audio element
const audioElement = document.getElementById('local-audio');
room.localParticipant.audioTrackPublications.forEach(publication => {
if (publication.track) {
publication.track.attach(audioElement);
}
});
// Mute only locally (does NOT affect publishing)
audioElement.muted = true;
// Unmute locally when needed
audioElement.muted = false;
• For React Components: If you're using @livekit/components-react, you can simply exclude your own audio from rendering in the RoomAudioRenderer or set the muted property on the audio element for your local participant.
This way, your audio continues to be shared with others while you avoid any self-audio feedback on your end. If you have any questions or need a hand with this, just let me know—I’m here to help!
Sources: JavaScript/TypeScript SDK | livekit/livekit_composite | DeepWiki | complex-agents/exa-deep-researcher/frontend/src/app/page.tsxwide-salesmen-41212
11/18/2025, 11:57 AM@livekit/components-react, you can simply exclude your own audio from rendering in the RoomAudioRenderer or set the muted property on the audio element for your local participant.tall-airline-16756
11/18/2025, 11:57 AM@livekit/components-react, the RoomAudioRenderer component is thoughtfully designed to exclude local participant audio by default. This means you don’t have to worry about hearing your own audio through this component—it’s already taken care of for you!
If you’d like to mute all audio tracks rendered by the RoomAudioRenderer, you can easily do so using the muted prop:
<RoomAudioRenderer muted={true} />
Additionally, if you want to adjust the volume of all audio tracks, the volume prop is there to help you:
<RoomAudioRenderer volume={0.5} /> // 50% volume
<RoomAudioRenderer volume={0} /> // Effectively muted
Please feel free to reach out if you have any more questions or need a hand with anything else—I’m here to help!
Sources: packages/react/etc/components-react.api.mdwide-salesmen-41212
11/18/2025, 12:17 PMtall-airline-16756
11/18/2025, 12:18 PMVideoTrack in LiveKit, it doesn’t include audio by default. That’s because video and audio are handled as separate tracks, so you’ll need to attach each one explicitly if you want both.
If you’re noticing audio coming through when you attach a VideoTrack, it might be because an AudioTrack is also being attached to the same element somewhere else. Just double-check to make sure only the VideoTrack is connected to your video element, and manage the audio tracks separately as needed.
Feel free to reach out if you’d like me to walk you through this or if you have any other questions—I’m here to help!
Sources: src/app/view/[room_name]/page.tsx | Realtime media | LiveKit Docswide-salesmen-41212
11/18/2025, 12:42 PMtall-airline-16756
11/18/2025, 12:44 PMVideoTrack component in @livekit/components-react — it doesn’t play audio by default, even if your track reference actually includes audio data. This happens because the component sets muted={true} on the underlying HTML <video> element to keep the audio from playing automatically.
That said, if your track reference has both video and audio streams (which is pretty common with WebRTC), the audio is still there in the media stream. The VideoTrack component just stops the browser from playing that audio part.
If you’d like to manage audio separately, you can try using the AudioTrack component or attach the audio track to its own element manually. Feel free to reach out if you want a hand setting this up — I’m here to help!
Sources: packages/react/src/components/RoomAudioRenderer.tsx | Handling events | LiveKit docs | src/app/view/[room_name]/page.tsx | Subscribing to tracks | LiveKit docswide-salesmen-41212
11/18/2025, 1:00 PMtall-airline-16756
11/18/2025, 1:01 PMroom.localParticipant.videoTrackPublications! Here are some friendly ways you can do that:
• Access the first video track:
const firstPublication = Array.from(room.localParticipant.videoTrackPublications.values())[0];
const track = firstPublication?.track;
• Iterate through all video track publications:
room.localParticipant.videoTrackPublications.forEach((publication, trackSid) => {
const track = publication.track;
if (track) {
console.log('Track:', track);
}
});
• Filter by track source (e.g., camera):
const cameraTracks = Array.from(room.localParticipant.videoTrackPublications.values())
.filter(publication => publication.source === Track.Source.Camera)
.map(publication => publication.track)
.filter(track => track !== undefined);
• Access by track SID:
const trackSid = 'your-track-sid';
const publication = room.localParticipant.videoTrackPublications.get(trackSid);
const track = publication?.track;
Just a quick tip: it’s always a good idea to check if the track property exists before you use it, since it might be null or undefined if the track isn’t subscribed or available locally. If you have any questions or want to dive deeper, I’m here to help—just let me know!
Sources: Rooms, participants, and tracks | LiveKit docs | lib/src/context/media_device_context.dart | src/room/Room.tswide-salesmen-41212
11/18/2025, 1:19 PMtall-airline-16756
11/18/2025, 1:21 PMgetTrackPublication on is undefined. Let’s walk through some common reasons and how we can fix them together:
• Undefined Participant Object: It’s important to make sure the participant object actually exists and is properly initialized before calling getTrackPublication. For example:
if (participant && typeof participant.getTrackPublication === 'function') {
const publication = participant.getTrackPublication(Track.Source.Camera);
}
• Timing Issues: Sometimes the room might not be fully connected or the participant might not be ready yet. Double-check that the room connection is established and the participant is initialized before accessing its methods.
• Dependency Conflicts: If you’re using yarn, it might help to switch to npm or try yarn-deduplicate to clear up any version conflicts between LiveKit packages.
If you feel comfortable sharing the specific code where this error pops up, your LiveKit SDK version, and whether you’re using yarn or npm, I’d be happy to help you troubleshoot more specifically. Please don’t hesitate to reach out if you need any more assistance—I’m here to help!
Sources: src/room/participant/LocalParticipant.ts | docs/index.html | Rooms, participants, and tracks | LiveKit docswide-salesmen-41212
11/19/2025, 8:09 AMtall-airline-16756
11/19/2025, 8:10 AMParticipantTile component tends to prioritize rendering video over audio when a track includes both, which means the audio part doesn’t get played.
But don’t worry! Here are a few friendly solutions you can try:
• Use `RoomAudioRenderer`: This is a great option! Just add the RoomAudioRenderer component alongside your ParticipantTile components, and it will automatically play all the audio tracks in the room:
import { RoomAudioRenderer } from '@livekit/components-react';
function MyComponent() {
return (
<>
<RoomAudioRenderer />
<ParticipantTile trackRef={trackRef} />
</>
);
}
• Render Both Components Explicitly: You can also provide custom children to ParticipantTile that include both VideoTrack and AudioTrack components, so both get rendered:
<ParticipantTile trackRef={trackRef}>
<VideoTrack trackRef={videoTrackRef} />
<AudioTrack trackRef={audioTrackRef} />
</ParticipantTile>
• Use Separate Components: Another approach is to use VideoTrack and AudioTrack independently, giving you full control:
export const MyComponent = ({ audioTrack, videoTrack }) => {
return (
<div>
<VideoTrack trackRef={videoTrack} />
<AudioTrack trackRef={audioTrack} />
</div>
);
};
Among these, the RoomAudioRenderer option is usually the simplest and makes sure all audio tracks are taken care of automatically. If you run into any more questions or need a hand with implementation, I’m here to help!
Sources: packages/react/src/components/participant/ParticipantAudioTile.tsx | Screen sharing | LiveKit docs | Subscribing to tracks | LiveKit docswide-salesmen-41212
11/26/2025, 9:22 AMtall-airline-16756
11/26/2025, 9:23 AMaudioTrackPublications map on the participant object. Here's how you can implement it:
• Subscribe to audio tracks:
if (participant?.audioTrackPublications) {
participant.audioTrackPublications.forEach(pub => pub.setSubscribed(true));
}
• Unsubscribe from audio tracks:
if (participant?.audioTrackPublications) {
participant.audioTrackPublications.forEach(pub => pub.setSubscribed(false));
}
These methods allow you to control whether the local participant is subscribed to the audio tracks of a remote participant. Let me know if you need further clarification or assistance!
Sources: Rooms, participants, and tracks | LiveKit docs | lib/src/participant/remote.dart | Runtime/Scripts/Room.cs | Subscribing to tracks | LiveKit docs | terminal-client/client.pywide-salesmen-41212
11/26/2025, 9:45 AMtall-airline-16756
11/26/2025, 9:46 AMaudio.lk-participant-media-audio element is typically created when an audio track is subscribed to or initialized in a participant's media stream, even if only video is expected. This can happen due to:
• Autoplay Policy Workarounds: On some devices, LiveKit creates a dummy audio element to ensure audio playback works correctly due to browser autoplay restrictions, even if no actual audio is transmitted.
• Default Audio Behavior: If audio is enabled by default in the participant options or session settings, LiveKit may initialize an audio track and attach it to the DOM.
• Track Subscription Workflow: During participant initialization, both audio and video tracks are evaluated, and dummy audio tracks may be added if audio is implicitly enabled.
• React Component Behavior: Components like ParticipantAudioTile may render audio elements as part of participant metadata, even if no active audio is expected.
To prevent unwanted audio elements, ensure that audio: false is explicitly set in the participant options or track creation options. Let me know if you need help adjusting your configuration!
Sources: src/room/events.ts | Agent session | LiveKit docs | packages/react/src/hooks/useMediaTrackBySourceOrName.tswide-salesmen-41212
11/26/2025, 10:44 AMtall-airline-16756
11/26/2025, 10:44 AMRoomAudioRenderer component in LiveKit is a React component that automatically handles and renders audio from all remote participants in a room. It ensures that audio tracks, such as microphones and screen share audio, are audible to the user.
Key features include:
• Subscribing to and rendering remote audio tracks (e.g., microphone, screen share audio).
• Filtering out local participant tracks to avoid self-audio playback.
• Optional props for control:
◦ volume: Adjusts the volume of all rendered audio tracks (e.g., volume={0.8}).
◦ muted: Mutes all audio tracks and stops the server from sending audio data when set to true.
◦ room: Specifies the room instance to render audio from (uses the room context if not provided).
It is typically used inside a LiveKitRoom component and works with components like StartAudio to enable audio playback after user interaction, adhering to browser autoplay policies.
Example usage:
<LiveKitRoom serverUrl={wsUrl} token={token} connect={true}>
<RoomAudioRenderer volume={0.8} />
<StartAudio label="Click to allow audio" />
</LiveKitRoom>
Let me know if you need further clarification or assistance!
Sources: packages/react/etc/components-react.api.md | web/src/components/room-component.tsx | README.mdwide-salesmen-41212
11/26/2025, 10:47 AMtall-airline-16756
11/26/2025, 10:47 AMRoomAudioRenderer component, audio from remote participants will not be automatically rendered in your application. This means:
• Remote participants' audio tracks (e.g., microphone or screen share audio) will not be audible to the user.
• You would need to manually handle audio track rendering by attaching audio tracks to HTML <audio> elements or using other components like AudioTrack.
• It may require additional effort to manage audio subscriptions and playback manually.
The RoomAudioRenderer simplifies this process by automatically handling all remote audio tracks for you. Let me know if you need guidance on manually managing audio tracks!wide-salesmen-41212
11/26/2025, 10:59 AMtall-airline-16756
11/26/2025, 10:59 AMRoomAudioRenderer component plays audio from all subscribed remote participants, even if those participants are not visually displayed in your custom React components. This is because RoomAudioRenderer operates independently of video rendering and is designed to handle all incoming audio tracks in the room.
If you want to control which participants' audio is played, you would need to manage audio subscriptions manually. For example, you can unsubscribe from audio tracks of participants you don't want to hear:
participant.audioTrackPublications.forEach(pub => pub.setSubscribed(false));
Let me know if you need help implementing this or further clarification!
Sources: web/src/components/room-wrapper.tsx | web/src/components/room-component.tsx | complex-agents/teleprompter/teleprompter-frontend/components/room.tsx | packages/react/etc/components-react.api.mdwide-salesmen-41212
11/26/2025, 11:23 AMtall-airline-16756
11/26/2025, 11:24 AMparticipant.audioTrackPublications.forEach(pub => pub.setSubscribed(false)); alongside RoomAudioRenderer. However, keep in mind the following:
• Effect on RoomAudioRenderer: If you unsubscribe from a participant's audio track using setSubscribed(false), RoomAudioRenderer will no longer play audio for that track because it only renders subscribed audio tracks.
• Convenience: This approach is convenient if you want to dynamically control which participants' audio is played while still leveraging RoomAudioRenderer to handle the playback of subscribed tracks automatically.
In summary, it is a valid and effective way to control audio playback selectively. Let me know if you need help implementing this!wide-salesmen-41212
11/26/2025, 11:27 AMtall-airline-16756
11/26/2025, 11:27 AMRoomAudioRenderer does not override your manual subscription settings. If you use pub.setSubscribed(false) to unsubscribe from a participant's audio track, RoomAudioRenderer will respect this and will not play audio for that track. Similarly, if you re-subscribe using pub.setSubscribed(true), RoomAudioRenderer will automatically start playing the audio for that track again.
In summary, RoomAudioRenderer only plays audio for tracks that are currently subscribed to, so your manual subscription logic works seamlessly with it. Let me know if you have further questions!wide-salesmen-41212
11/26/2025, 11:36 AMtall-airline-16756
11/26/2025, 11:36 AMRoomAudioRenderer should automatically update and reflect changes when you subscribe or unsubscribe to audio tracks. It uses the useTracks hook to dynamically render audio for all currently subscribed tracks. If you unsubscribe from a track, it will stop playing that track's audio, and if you re-subscribe, it will start playing the audio again.
However, RoomAudioRenderer does not handle the subscription logic itself. You need to manage subscriptions manually or rely on LiveKit's autoSubscribe setting. If you're experiencing issues where audio is not being rendered after re-subscribing, it could be due to:
• Delays in the subscription process or track availability.
• Potential issues with the track's state or the participant's connection.
If the issue persists, let me know, and I can help troubleshoot further!
Sources: Subscribing to tracks | LiveKit docs | packages/react/CHANGELOG.md | Handling events | LiveKit docswide-salesmen-41212
11/26/2025, 12:06 PMtall-airline-16756
11/26/2025, 12:06 PMsetSubscribed(false). Here's an example:
room.participants.forEach((participant) => {
participant.audioTrackPublications.forEach((pub) => {
if (pub.setSubscribed) {
pub.setSubscribed(false);
}
});
});
This will ensure that you are unsubscribed from all audio tracks of all remote participants. Let me know if you need further assistance!