content/media/webaudio/test/test_audioParamTimelineDestinationOffset.html

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test AudioParam timeline events scheduled after the destination stream has started playback</title>
     5   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <script type="text/javascript" src="webaudio.js"></script>
     7   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     8 </head>
     9 <body>
    10 <pre id="test">
    11 <script class="testbody" type="text/javascript">
    13 var gTest = {
    14   length: 16384,
    15   numberOfChannels: 1,
    16   createGraphAsync: function(context, callback) {
    17     var sourceBuffer = context.createBuffer(1, 2048, context.sampleRate);
    18     for (var i = 0; i < 2048; ++i) {
    19       sourceBuffer.getChannelData(0)[i] = 1;
    20     }
    22     setTimeout(function() {
    23       var source = context.createBufferSource();
    24       source.buffer = sourceBuffer;
    25       source.start(context.currentTime);
    26       source.stop(context.currentTime + sourceBuffer.duration);
    28       var gain = context.createGain();
    29       gain.gain.setValueAtTime(0, context.currentTime);
    30       gain.gain.setTargetAtTime(0, context.currentTime + sourceBuffer.duration, 1);
    31       source.connect(gain);
    33       callback(gain);
    34     }, 100);
    35   },
    36 };
    38 runTest();
    40 </script>
    41 </pre>
    42 </body>
    43 </html>

mercurial