| See if we can load an AudioBuffer, create an AudioBufferSourceNode, attach the buffer to it, then play it. |
| <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", |
| testRunner.waitUntilDone(); |
| function finishedLoading(bufferList) { |
| var bufferSource = context.createBufferSource(); |
| bufferSource.buffer = bufferList[0]; |
| bufferSource.connect(context.destination); |
| context.oncomplete = finishAudioTest; |
| context.startRendering(); |