| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <!-- | 3 <!-- |
| 4 Tests that an audio-rate signal (AudioNode output) can be connected to an AudioP
aram. | 4 Tests that an audio-rate signal (AudioNode output) can be connected to an AudioP
aram. |
| 5 Specifically, this tests that an audio-rate signal coming from an AudioBufferSou
rceNode | 5 Specifically, this tests that an audio-rate signal coming from an AudioBufferSou
rceNode |
| 6 playing an AudioBuffer containing a specific curve can be connected to an AudioG
ainNode's | 6 playing an AudioBuffer containing a specific curve can be connected to an AudioG
ainNode's |
| 7 .gain attribute (an AudioParam). Another AudioBufferSourceNode will be the audi
o source | 7 .gain attribute (an AudioParam). Another AudioBufferSourceNode will be the audi
o source |
| 8 having its gain changed. We load this one with an AudioBuffer containing a cons
tant value of 1. | 8 having its gain changed. We load this one with an AudioBuffer containing a cons
tant value of 1. |
| 9 Thus it's easy to check that the resultant signal should be equal to the gain-sc
aling curve. | 9 Thus it's easy to check that the resultant signal should be equal to the gain-sc
aling curve. |
| 10 --> | 10 --> |
| 11 | 11 |
| 12 <html> | 12 <html> |
| 13 <head> | 13 <head> |
| 14 <script src="resources/compatibility.js"></script> |
| 14 <script src="resources/audio-testing.js"></script> | 15 <script src="resources/audio-testing.js"></script> |
| 15 <script src="../resources/js-test.js"></script> | 16 <script src="../resources/js-test.js"></script> |
| 16 | 17 |
| 17 </head> | 18 </head> |
| 18 <body> | 19 <body> |
| 19 | 20 |
| 20 <script> | 21 <script> |
| 21 | 22 |
| 22 var sampleRate = 44100.0; | 23 var sampleRate = 44100.0; |
| 23 var lengthInSeconds = 1; | 24 var lengthInSeconds = 1; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (window.testRunner) { | 62 if (window.testRunner) { |
| 62 testRunner.dumpAsText(); | 63 testRunner.dumpAsText(); |
| 63 testRunner.waitUntilDone(); | 64 testRunner.waitUntilDone(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 window.jsTestIsAsync = true; | 67 window.jsTestIsAsync = true; |
| 67 | 68 |
| 68 var sampleFrameLength = sampleRate * lengthInSeconds; | 69 var sampleFrameLength = sampleRate * lengthInSeconds; |
| 69 | 70 |
| 70 // Create offline audio context. | 71 // Create offline audio context. |
| 71 context = new webkitOfflineAudioContext(1, sampleFrameLength, sampleRate); | 72 context = new OfflineAudioContext(1, sampleFrameLength, sampleRate); |
| 72 | 73 |
| 73 // Create buffer used by the source which will have its gain controlled. | 74 // Create buffer used by the source which will have its gain controlled. |
| 74 constantOneBuffer = createConstantBuffer(context, sampleFrameLength, 1); | 75 constantOneBuffer = createConstantBuffer(context, sampleFrameLength, 1); |
| 75 | 76 |
| 76 // Create buffer used to control gain. | 77 // Create buffer used to control gain. |
| 77 linearRampBuffer = createLinearRampBuffer(context, sampleFrameLength); | 78 linearRampBuffer = createLinearRampBuffer(context, sampleFrameLength); |
| 78 | 79 |
| 79 // Create the two sources. | 80 // Create the two sources. |
| 80 | 81 |
| 81 var constantSource = context.createBufferSource(); | 82 var constantSource = context.createBufferSource(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 105 context.startRendering(); | 106 context.startRendering(); |
| 106 } | 107 } |
| 107 | 108 |
| 108 runTest(); | 109 runTest(); |
| 109 successfullyParsed = true; | 110 successfullyParsed = true; |
| 110 | 111 |
| 111 </script> | 112 </script> |
| 112 | 113 |
| 113 </body> | 114 </body> |
| 114 </html> | 115 </html> |
| OLD | NEW |