diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index cc9368d..934e876 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -119,11 +119,11 @@ return audioContext } - function playBeep(frequency, duration, type = 'sine') { + async function playBeep(frequency, duration, type = 'sine') { try { const ctx = getAudioContext() if (ctx.state === 'suspended') { - ctx.resume() + await ctx.resume() } const oscillator = ctx.createOscillator() const gainNode = ctx.createGain() diff --git a/frontend/src/components/Settings.svelte b/frontend/src/components/Settings.svelte index b25e779..5e1a4df 100644 --- a/frontend/src/components/Settings.svelte +++ b/frontend/src/components/Settings.svelte @@ -40,12 +40,12 @@ return audioContext } - function playBeep(frequency, duration, type = 'sine') { + async function playBeep(frequency, duration, type = 'sine') { try { const ctx = getAudioContext() // Resume context if suspended (required by browsers on first interaction) if (ctx.state === 'suspended') { - ctx.resume() + await ctx.resume() } const oscillator = ctx.createOscillator() const gainNode = ctx.createGain()