Quick answer: Browsers suspend the Web AudioContext when tabs are backgrounded and Construct 3 doesn’t always auto-resume. Wire System On suspended to Audio Pause All and System On resumed to Audio Resume All, plus an explicit audioCtx.resume() via Browser Execute JavaScript.

You ship your HTML5 game to itch.io. A player alt-tabs to Discord, comes back, and the music is gone. Sound effects still play but the music track is dead until they refresh. The bug is browser audio suspension, and Construct’s default behavior after resume is not robust.

How Browsers Suspend Audio

Modern browsers suspend the Web Audio API when a tab is hidden or backgrounded. This saves battery on laptops and mobile. When the tab comes back, the context is in a suspended state. Any audio that was playing pauses. Until audioCtx.resume() is called, no new audio plays either.

The Fix

Step 1: Pause and resume via the System object.

On suspended → Audio: Pause all
On resumed → Audio: Resume all

Step 2: Force the AudioContext to resume. Construct sometimes leaves the context in suspended state even after Resume All. Add a Browser: Execute JavaScript action:

if (window.c3_runtime) {
    const ctx = c3_runtime.GetAudioManager().GetAudioContext();
    if (ctx && ctx.state === "suspended") {
        ctx.resume();
    }
}

Step 3: Re-play music that went dead. Some browsers silence specific tracks rather than the whole context. After resume, check if your music layer is still playing and restart it if not.

The Autoplay Policy Gotcha

The first AudioContext creation requires a user gesture. If your game starts audio before the player has clicked, browsers mute everything. Add a Click to play overlay on first launch and start audio only after the click. Subsequent alt-tabs don’t need gestures; only the initial creation does.

Mobile Considerations

iOS Safari aggressively silences audio when the app backgrounds. In some cases, audio never resumes automatically and requires a new user gesture. For mobile web games, show a tap-to-resume prompt if audioCtx.state === "suspended" after resume.

Verifying

Open Chrome DevTools, go to Application → Background Services → Audio, and watch the state as you alt-tab. With the fix, state transitions: running → suspended → running. Without it, state sticks at suspended after return.

“Web audio is only ever reliable if you treat suspension as the default state. Wire focus handlers explicitly and your music outlasts every alt-tab.”

Related Issues

For first-touch audio issues on mobile, see Construct 3 audio not playing on first touch. For browser-specific audio bugs, see Construct 3 audio not playing in browser.

Always test the alt-tab roundtrip. It’s the most common failure mode for web audio and the easiest to miss.