From e29c241d4eba34b7a5fb86949c07b572df54dc01 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Tue, 29 Jul 2025 14:21:00 +0200 Subject: [PATCH] wip init audioOutput device with user choice and persist it --- .../src/features/rooms/components/Conference.tsx | 9 ++++++++- .../src/features/settings/components/tabs/AudioTab.tsx | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/features/rooms/components/Conference.tsx b/src/frontend/src/features/rooms/components/Conference.tsx index 52e209f7..cb21451f 100644 --- a/src/frontend/src/features/rooms/components/Conference.tsx +++ b/src/frontend/src/features/rooms/components/Conference.tsx @@ -97,9 +97,16 @@ export const Conference = ({ audioCaptureDefaults: { deviceId: userConfig.audioDeviceId ?? undefined, }, + audioOutput: { + deviceId: userConfig.audioOutputDeviceId ?? undefined, + }, } // do not rely on the userConfig object directly as its reference may change on every render - }, [userConfig.videoDeviceId, userConfig.audioDeviceId]) + }, [ + userConfig.videoDeviceId, + userConfig.audioDeviceId, + userConfig.audioOutputDeviceId, + ]) const room = useMemo(() => new Room(roomOptions), [roomOptions]) diff --git a/src/frontend/src/features/settings/components/tabs/AudioTab.tsx b/src/frontend/src/features/settings/components/tabs/AudioTab.tsx index f4d3e77f..3f5a6ec5 100644 --- a/src/frontend/src/features/settings/components/tabs/AudioTab.tsx +++ b/src/frontend/src/features/settings/components/tabs/AudioTab.tsx @@ -95,6 +95,7 @@ export const AudioTab = ({ id }: AudioTabProps) => { userChoices: { noiseReductionEnabled }, saveAudioInputDeviceId, saveNoiseReductionEnabled, + saveAudioOutputDeviceId, } = usePersistentUserChoices() const isSpeaking = useIsSpeaking(localParticipant) @@ -183,9 +184,10 @@ export const AudioTab = ({ id }: AudioTabProps) => { defaultSelectedKey={ activeDeviceIdOut || getDefaultSelectedKey(itemsOut) } - onSelectionChange={async (key) => + onSelectionChange={async (key) => { setActiveMediaDeviceOut(key as string) - } + saveAudioOutputDeviceId(key as string) + }} {...disabledProps} style={{ minWidth: 0,