| Create two sources and play them simultaneously. This tests unity-gain summing of AudioNode inputs. |
| The result should be some laughing playing at the same time as the drumming. |
| <script type="text/javascript" src="resources/audio-testing.js"></script> |
| <script type="text/javascript" src="resources/buffer-loader.js"></script> |
| var sampleRate = 44100.0; |
| // Create offline audio context. |
| context = new webkitOfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRate); |
| bufferLoader = new BufferLoader( |
| "resources/hyper-reality/br-jam-loop.wav", |
| "resources/hyper-reality/laughter.wav", |
| testRunner.waitUntilDone(); |
| function finishedLoading(bufferList) { |
| // Create two sources and play them at the same time. |
| var source1 = context.createBufferSource(); |
| var source2 = context.createBufferSource(); |
| source1.buffer = bufferList[0]; |
| source2.buffer = bufferList[1]; |
| source1.connect(context.destination); |
| source2.connect(context.destination); |
| context.oncomplete = finishAudioTest; |
| context.startRendering(); |