4 See if we can load an AudioBuffer, create an AudioBufferSourceNode, attach the buffer to it, then play it.
9 <script type=
"text/javascript" src=
"resources/audio-testing.js"></script>
10 <script type=
"text/javascript" src=
"resources/buffer-loader.js"></script>
16 var sampleRate
= 44100.0;
17 var lengthInSeconds
= 2;
23 if (!window
.testRunner
)
26 // Create offline audio context.
27 context
= new OfflineAudioContext(2, sampleRate
* lengthInSeconds
, sampleRate
);
29 bufferLoader
= new BufferLoader(
32 "resources/hyper-reality/br-jam-loop.wav",
38 testRunner
.waitUntilDone();
41 function finishedLoading(bufferList
) {
42 var bufferSource
= context
.createBufferSource();
43 bufferSource
.buffer
= bufferList
[0];
45 bufferSource
.connect(context
.destination
);
46 bufferSource
.start(0);
48 context
.oncomplete
= finishAudioTest
;
49 context
.startRendering();