OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <!-- | 3 <!-- |
4 Test up mixing from mono to 5.1. | 4 Test up mixing from mono to 5.1. |
5 --> | 5 --> |
6 | 6 |
7 <html> | 7 <html> |
8 <head> | 8 <head> |
9 <script type="text/javascript" src="resources/audio-testing.js"></script> | 9 <script type="text/javascript" src="resources/audio-testing.js"></script> |
10 <script type="text/javascript" src="resources/mix-testing.js"></script> | 10 <script type="text/javascript" src="resources/mix-testing.js"></script> |
11 </head> | 11 </head> |
12 <body> | 12 <body> |
13 | 13 |
14 <script> | 14 <script> |
15 | 15 |
16 function runTest() { | 16 function runTest() { |
17 if (!window.testRunner) | 17 if (!window.testRunner) |
18 return; | 18 return; |
19 | 19 |
20 testRunner.waitUntilDone(); | 20 testRunner.waitUntilDone(); |
21 | 21 |
22 window.jsTestAsync = true; | 22 window.jsTestAsync = true; |
23 | 23 |
24 // Create offline audio context | 24 // Create offline audio context |
25 var sampleRate = 44100.0; | 25 var sampleRate = 44100.0; |
26 var context = new webkitOfflineAudioContext(6, sampleRate * toneLengthSecond
s, sampleRate); | 26 var context = new OfflineAudioContext(6, sampleRate * toneLengthSeconds, sam
pleRate); |
27 var toneBuffer = createToneBuffer(context, 440, toneLengthSeconds, 1); | 27 var toneBuffer = createToneBuffer(context, 440, toneLengthSeconds, 1); |
28 | 28 |
29 var source = context.createBufferSource(); | 29 var source = context.createBufferSource(); |
30 source.buffer = toneBuffer; | 30 source.buffer = toneBuffer; |
31 | 31 |
32 source.connect(context.destination); | 32 source.connect(context.destination); |
33 source.start(0); | 33 source.start(0); |
34 | 34 |
35 context.oncomplete = finishAudioTest; | 35 context.oncomplete = finishAudioTest; |
36 context.startRendering(); | 36 context.startRendering(); |
37 } | 37 } |
38 | 38 |
39 runTest(); | 39 runTest(); |
40 </script> | 40 </script> |
41 | 41 |
42 </body> | 42 </body> |
43 </html> | 43 </html> |
OLD | NEW |