tor-browser

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

k-rate-gain.html (1371B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>Test k-rate AudioParam of GainNode</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 GainNode', (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: 'GainNode',
     29          nodeOptions: null,
     30          prefix: 'GainNode',
     31          // Set AudioParam to k-rate
     32          rateSettings: [{name: 'gain', value: 'k-rate'}],
     33          // Automate
     34          automations: [{
     35            name: 'gain',
     36            methods: [
     37              {name: 'setValueAtTime', options: [1, 0]},
     38              {name: 'linearRampToValueAtTime', options: [0, testDuration]}
     39            ]
     40          }]
     41        }).then(() => task.done());
     42      });
     43 
     44      audit.run();
     45    </script>
     46  </body>
     47 </html>