From 244f6c156d2e33d9d93263f3303fb2f0333f4742 Mon Sep 17 00:00:00 2001 From: Timo Date: Fri, 23 May 2025 16:58:37 +0200 Subject: [PATCH] one more try --- src/useAudioContext.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/useAudioContext.tsx b/src/useAudioContext.tsx index 0ed2abb3..a5f7436c 100644 --- a/src/useAudioContext.tsx +++ b/src/useAudioContext.tsx @@ -110,7 +110,11 @@ export function useAudioContext( // Update the sink ID whenever we change devices. useEffect(() => { - if (audioContext && "setSinkId" in audioContext) { + if ( + audioContext && + "setSinkId" in audioContext && + audioOutput.selectedWebDeviceId + ) { // https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId // @ts-expect-error - setSinkId doesn't exist yet in types, maybe because it's not supported everywhere. audioContext.setSinkId(audioOutput.selectedWebDeviceId).catch((ex) => {