1 var defaultSampleRate = 44100.0;
2 var lengthInSeconds = 1;
7 // Run test by loading the file specified by |url|. An optional sample rate can be given to
8 // select a context with a different sample rate. The default value is |defaultSampleRate|.
9 function runDecodingTest(url, optionalSampleRate)
11 if (!window.testRunner)
14 var sampleRate = (typeof optionalSampleRate === "undefined") ? defaultSampleRate : optionalSampleRate;
16 // Create offline audio context.
17 context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRate);
19 bufferLoader = new BufferLoader(
26 testRunner.waitUntilDone();
29 function finishedLoading(bufferList)
31 testRunner.setAudioData(createAudioData(bufferList[0]));
32 testRunner.notifyDone();