developer option to mute all audio (#3239)

This commit is contained in:
Timo
2025-05-13 21:11:12 +02:00
committed by GitHub
parent 34b3b9d733
commit 04bc6c77a3
8 changed files with 45 additions and 11 deletions

View File

@@ -47,6 +47,7 @@ interface Props<S extends string> {
*/
sounds: PrefetchedSounds<S> | null;
latencyHint: AudioContextLatencyCategory;
muted?: boolean;
}
interface UseAudioContext<S> {
@@ -112,7 +113,7 @@ export function useAudioContext<S extends string>(
}, [audioContext, devices]);
// Don't return a function until we're ready.
if (!audioContext || !audioBuffers) {
if (!audioContext || !audioBuffers || props.muted) {
return null;
}
return {