4 Create two sources and play them simultaneously. This tests unity-gain summing of AudioNode inputs.
5 The result should be some laughing playing at the same time as the drumming.
10 <script type="text/javascript" src="resources/audio-testing.js"></script>
11 <script type="text/javascript" src="resources/buffer-loader.js"></script>
20 var sampleRate = 44100.0;
21 var lengthInSeconds = 2;
27 if (!window.testRunner)
30 // Create offline audio context.
31 context = new webkitOfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRate);
33 bufferLoader = new BufferLoader(
36 "resources/hyper-reality/br-jam-loop.wav",
37 "resources/hyper-reality/laughter.wav",
43 testRunner.waitUntilDone();
46 function finishedLoading(bufferList) {
47 // Create two sources and play them at the same time.
48 var source1 = context.createBufferSource();
49 var source2 = context.createBufferSource();
50 source1.buffer = bufferList[0];
51 source2.buffer = bufferList[1];
53 source1.connect(context.destination);
54 source2.connect(context.destination);
58 context.oncomplete = finishAudioTest;
59 context.startRendering();