music-practice-tools / bbs-mixer

A simple web audio mixer
https://mixer.musicpracticetools.net
Other
0 stars 0 forks source link

Stop mute click #2

Closed SteveALee closed 2 months ago

SteveALee commented 3 months ago

Sometime get a click with mute.

Will be if you hit mute just as loud sample is playing.

Use gainNode's methods rather than just set value

SteveALee commented 2 months ago

I used the recommended approach but then faders fail. maybe .value is getting messed up?

  /* seems to be problems with using gain functions
  function gainSetter(audioContext, node, timeConstant = 0.04, timeOffset = 0) {
    return (value) => {
      const prevGain = node.gain.value
      node.gain.setTargetAtTime(
        value,
        audioContext.currentTime + timeOffset,
        timeConstant,
      )
      return prevGain
    }
  }
*/