From 0bb9632b600920fbee1a968f5853f688eeb5ba4b Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Fri, 2 Oct 2026 11:46:54 +0200 Subject: [PATCH] review play sounds does not throw --- src/useAudioContext.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/useAudioContext.tsx b/src/useAudioContext.tsx index 68114812d..d52efb0fc 100644 --- a/src/useAudioContext.tsx +++ b/src/useAudioContext.tsx @@ -209,7 +209,9 @@ export function useAudioContext( }, playSoundLooping: (name, delayS: number): (() => Promise) => { if (!audioBuffers[name]) { - throw Error(`Tried to play a sound that wasn't buffered (${name})`); + // We do not throw here. Instead we log and let the component life. Its not a fatal error if sounds are missing. + logger.debug(`Tried to play a sound that wasn't buffered (${name})`); + return async () => {}; } return playSoundLooping( audioContext,