| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <!-- | 3 <!-- |
| 4 Tests that AudioBufferSourceNode supports loop-points with .loopStart and .loopE
nd. | 4 Tests that AudioBufferSourceNode supports loop-points with .loopStart and .loopE
nd. |
| 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 | 10 |
| 11 </head> | 11 </head> |
| 12 <body> | 12 <body> |
| 13 | 13 |
| 14 <script> | 14 <script> |
| 15 | 15 |
| 16 window.onload = init; | 16 window.onload = init; |
| 17 | 17 |
| 18 var sampleRate = 44100.0; | 18 var sampleRate = 44100.0; |
| 19 var numberOfNotes = 72; // play over a 6 octave range | 19 var numberOfNotes = 60; // play over a 5 octave range |
| 20 var noteDuration = 0.100; | 20 var noteDuration = 0.025; |
| 21 var noteSpacing = noteDuration + 0.005; // leave 5ms of silence between each "no
te" | 21 var noteSpacing = noteDuration + 0.005; // leave 5ms of silence between each "no
te" |
| 22 var lengthInSeconds = numberOfNotes * noteSpacing; | 22 var lengthInSeconds = numberOfNotes * noteSpacing; |
| 23 | 23 |
| 24 var context = 0; | 24 var context = 0; |
| 25 var buffer = 0; | 25 var buffer = 0; |
| 26 | 26 |
| 27 function createTestBuffer(frequency, sampleRate) { | 27 function createTestBuffer(frequency, sampleRate) { |
| 28 // Create a buffer containing two periods at this frequency. | 28 // Create a buffer containing two periods at this frequency. |
| 29 // The 1st half is a pure sine wave period scaled by a linear ramp from 0 ->
1. | 29 // The 1st half is a pure sine wave period scaled by a linear ramp from 0 ->
1. |
| 30 // The 2nd half of the buffer corresponds exactly to one pure sine wave peri
od. | 30 // The 2nd half of the buffer corresponds exactly to one pure sine wave peri
od. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 context.oncomplete = finishAudioTest; | 102 context.oncomplete = finishAudioTest; |
| 103 context.startRendering(); | 103 context.startRendering(); |
| 104 | 104 |
| 105 testRunner.waitUntilDone(); | 105 testRunner.waitUntilDone(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 </script> | 108 </script> |
| 109 | 109 |
| 110 </body> | 110 </body> |
| 111 </html> | 111 </html> |
| OLD | NEW |