Skip to content

add voiceIsolation to WebRTC#487

Open
AngeloGiacco wants to merge 1 commit into
mainfrom
add-voice-isolation-webrtc
Open

add voiceIsolation to WebRTC#487
AngeloGiacco wants to merge 1 commit into
mainfrom
add-voice-isolation-webrtc

Conversation

@AngeloGiacco

@AngeloGiacco AngeloGiacco commented Jan 31, 2026

Copy link
Copy Markdown
Collaborator

-voiceIsolation: true was already enabled for WebSocket connections (ininput.ts)
-WebRTC was missing this because it uses LiveKit's APIs instead of the shared Input class
-This PR adds voiceIsolation to WebRTC for both initial mic setup and device switching

// Track mock calls using a global object that can be accessed after mocking
const mockCalls = {
setMicrophoneEnabled: [] as boolean[],
createLocalAudioTrack: [] as unknown[],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use proper types instead of unknown?


// Create constraints for the new input device
const audioConstraints: MediaTrackConstraints = {
const audioConstraints = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the type?

// Enable microphone only if not text-only mode
if (!config.textOnly) {
await room.localParticipant.setMicrophoneEnabled(true);
const audioConstraints = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is duplicated below, can we extract this? Also are we sure that setMicrophoneEnabled doesn't already do this?

@kraenhansen
kraenhansen removed their request for review March 12, 2026 08:12
@kraenhansen

Copy link
Copy Markdown
Member

Removed myself as reviewer to avoid reminders, feel free to add me back when / if it's considered ready for review 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants