Skip to content

bug(audio): volume not applied — GainNode gain ignored after applyMix() called pre-gesture #39

Closed

Description

@thcp

Summary

Even when audio did play, volume changes from the mixer faders had no effect. All stems played at default gain regardless of fader position.

Root cause

applyMix() was called during canplay (before any user gesture), creating a GainNode on a suspended AudioContext. The gain was set, but the AudioContext never processed it correctly. On subsequent play events, the GainNode was already set with a stale/wrong gain value.

Fix

applyMix() lazily creates the GainNode only when ctx.state === "running" (i.e. after the user's first play gesture). Pre-gesture calls fall back to audioEl.volume.

Release

0.5.0-alpha.1

Activity

  1. added this to the 0.5.0-alpha.1 milestone on May 17, 2026
  2. added
    bugSomething isn't working
    on May 17, 2026
  3. thcp commented on May 17, 2026

    @thcp
    CollaboratorAuthor

    Fixed in this session: applyMix() now uses audioEl.volume for HTMLMediaElement tracks instead of GainNode, so volume is always applied regardless of AudioContext gesture state.

  4. self-assigned this
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions