tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

k-rate-delay.html (1444B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>Test k-rate AudioParam of DelayNode</title>
      5    <script src="/resources/testharness.js"></script>
      6    <script src="/resources/testharnessreport.js"></script>
      7    <script src="/webaudio/resources/audit-util.js"></script>
      8    <script src="/webaudio/resources/audit.js"></script>
      9    <script src="automation-rate-testing.js"></script>
     10  </head>
     11 
     12  <body>
     13    <script>
     14      let audit = Audit.createTaskRunner();
     15 
     16      audit.define('Test k-rate DelayNode', (task, should) => {
     17        // Arbitrary sample rate and duration.
     18        let sampleRate = 8000;
     19        let testDuration = 1;
     20        let context = new OfflineAudioContext({
     21          numberOfChannels: 3,
     22          sampleRate: sampleRate,
     23          length: testDuration * sampleRate
     24        });
     25 
     26 
     27        doTest(context, should, {
     28          nodeName: 'DelayNode',
     29          nodeOptions: null,
     30          prefix: 'DelayNode',
     31          // Set all AudioParams to k-rate
     32          rateSettings: [{name: 'delayTime', value: 'k-rate'}],
     33          // Automate just the frequency
     34          automations: [{
     35            name: 'delayTime',
     36            methods: [
     37              {name: 'setValueAtTime', options: [0, 0]}, {
     38                name: 'linearRampToValueAtTime',
     39                options: [.5, testDuration]
     40              }
     41            ]
     42          }]
     43        }).then(() => task.done());
     44      });
     45 
     46      audit.run();
     47    </script>
     48  </body>
     49 </html>