thenfour / digifujam

32 stars 1 forks source link

race condition causing exception: setFeedbackGain undefined on delaynode of mixer instrument #212

Closed thenfour closed 2 years ago

thenfour commented 2 years ago

only seen on Firefox, and intermittent. synth initialization is asynchronous due to loading the reverb impulse. therefore, if you somehow connect and enter a 7jam room before synth is initialized, instruments get initialized, and exceptions will occur.

in this case, mixer instrument was initialized with an undefined master delay node.

there are obvious ways to solve this:

  1. the reverb impulse is the only reason the synth init is async. how about embedding it?
  2. just be sensitive to async behavior. if you connect before the synth is initialized, then delay continuing.
  3. create the nodes and set the convolver buffer after it's loaded, instead of delaying the entire fx chain.