one more try

This commit is contained in:
Timo
2025-05-23 16:58:37 +02:00
parent b299be5c21
commit 244f6c156d

View File

@@ -110,7 +110,11 @@ export function useAudioContext<S extends string>(
// 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) => {