OLD | NEW |
1 var sampleRate = 44100; | 1 var sampleRate = 44100; |
2 | 2 |
3 // Information about the starting/ending times and starting/ending values for ea
ch time interval. | 3 // Information about the starting/ending times and starting/ending values for ea
ch time interval. |
4 var timeValueInfo; | 4 var timeValueInfo; |
5 | 5 |
6 // The difference between starting values between each time interval. | 6 // The difference between starting values between each time interval. |
7 var startingValueDelta; | 7 var startingValueDelta; |
8 | 8 |
9 // For any automation function that has an end or target value, the end value is
based the starting | 9 // For any automation function that has an end or target value, the end value is
based the starting |
10 // value of the time interval. The starting value will be increased or decrease
d by | 10 // value of the time interval. The starting value will be increased or decrease
d by |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 function createAudioGraphAndTest(numberOfTests, initialValue, setValueFunction,
automationFunction, testName, maxError, referenceFunction, jumpThreshold) | 398 function createAudioGraphAndTest(numberOfTests, initialValue, setValueFunction,
automationFunction, testName, maxError, referenceFunction, jumpThreshold) |
399 { | 399 { |
400 if (window.testRunner) { | 400 if (window.testRunner) { |
401 testRunner.dumpAsText(); | 401 testRunner.dumpAsText(); |
402 testRunner.waitUntilDone(); | 402 testRunner.waitUntilDone(); |
403 } | 403 } |
404 | 404 |
405 window.jsTestIsAsync = true; | 405 window.jsTestIsAsync = true; |
406 | 406 |
407 // Create offline audio context. | 407 // Create offline audio context. |
408 context = new webkitOfflineAudioContext(2, renderLength(numberOfTests), samp
leRate); | 408 context = new OfflineAudioContext(2, renderLength(numberOfTests), sampleRate
); |
409 var constantBuffer = createConstantBuffer(context, 1, renderLength(numberOfT
ests)); | 409 var constantBuffer = createConstantBuffer(context, 1, renderLength(numberOfT
ests)); |
410 | 410 |
411 // We use an AudioGainNode here simply as a convenient way to test the Audio
Param | 411 // We use an AudioGainNode here simply as a convenient way to test the Audio
Param |
412 // automation, since it's easy to pass a constant value through the node, au
tomate the | 412 // automation, since it's easy to pass a constant value through the node, au
tomate the |
413 // .gain attribute and observe the resulting values. | 413 // .gain attribute and observe the resulting values. |
414 | 414 |
415 gainNode = context.createGain(); | 415 gainNode = context.createGain(); |
416 | 416 |
417 var bufferSource = context.createBufferSource(); | 417 var bufferSource = context.createBufferSource(); |
418 bufferSource.buffer = constantBuffer; | 418 bufferSource.buffer = constantBuffer; |
(...skipping 12 matching lines...) Expand all Loading... |
431 setValueFunction, | 431 setValueFunction, |
432 automationFunction); | 432 automationFunction); |
433 bufferSource.start(0); | 433 bufferSource.start(0); |
434 | 434 |
435 context.oncomplete = checkResultFunction(testName, | 435 context.oncomplete = checkResultFunction(testName, |
436 maxError, | 436 maxError, |
437 referenceFunction, | 437 referenceFunction, |
438 jumpThreshold); | 438 jumpThreshold); |
439 context.startRendering(); | 439 context.startRendering(); |
440 } | 440 } |
OLD | NEW |