Web audio node connected to two amplification nodes connected to destination duplicate speed / step

As the title says, if I have a sound node that emits sound and I connect it to two separate GainNodes, which in turn are connected to the audio context destination, the audio plays at double speed / double step (as if half samples are sent one node gain and half samples to the other, and the time is halved).

I created a handy jsfiddle here , just drag and drop your audio files into the black rectangle and listen.

// audioContext: Web Audio context
// decoded: decoded audioBuffer
// gainNode1, gainNode2: gain nodes
var bSrc = audioContext.createBufferSource();
bSrc.connect (gainNode1);
bSrc.connect (gainNode2);
gainNode1.connect (audioContext.destination);
gainNode2.connect (audioContext.destination);
bSrc.buffer = decoded;
bSrc.loop = false;
// You'll hear two double-speed buffers playing at unison
bSrc.start(0);

      

Is it by design? I would like to accurately "duplicate" the sound (which will be sent on two different routes, the violin is just a proof of concept for a larger project).

Edit:

  • I tested this in Chrome version 24.0.1312.56/Ubuntu 12.10 and the behavior is present.
  • The behavior is also present in Chrome version 24.0.1312.68/Ubuntu 12.10
  • In Chrome version 24.0.1312.57/Mac OSX Audio API works well and this behavior is not.

Could this be a Linux-only problem?

+3


source to share


1 answer


Sounds like a problem with Linux implementation. It works for me in Chrome on OS X.



+1


source







All Articles