<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>127674</bug_id>
          
          <creation_ts>2014-01-27 00:14:44 -0800</creation_ts>
          <short_desc>bufferSource&apos;s playbackRate param not controlled by oscillator (as in spec).</short_desc>
          <delta_ts>2014-01-27 00:23:43 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Audio</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.9</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jason Custer">jscuster</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>crogers</cc>
    
    <cc>jscuster</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>972350</commentid>
    <comment_count>0</comment_count>
      <attachid>222306</attachid>
    <who name="Jason Custer">jscuster</who>
    <bug_when>2014-01-27 00:14:44 -0800</bug_when>
    <thetext>Created attachment 222306
html file with a similar script imbedded. When loaded, sound starts playing. When the bug is fixed, it will play with pitch oscillating.

With this graph, vibrato should occur.
bufferSource.playbackRate &lt; gain &lt; oscillator.
In other words, connecting an oscillator (via gain to control depth) to the playbackRate audio parameter of a bufferSource node should change the pitch of a playing sound. 

The following script should cause the frequency of the bufferSource to range between 220Hz to 880Hz in a sinewave.

var c = window.webkitAudioContext ? new webkitAudioContext() : new AudioContext(),
b=c.createBuffer(1, 441, 44100), //one cycle of a 440Hz waveform at 44100 samples per sec
d=b.getChannelData(0), //a float32 array (to store generated data). 
n=c.createBufferSource(), //to play the buffer
amp=c.createGain(), //the amplitude of vibrato
master = c.createGain(), //so we don&apos;t blast our ears off
lfo = c.createOscillator(); //the oscillator for pitch change
n.playbackRate = 1.5; //depth will be 0.5, taking playbackRate from 1 (when osc = -0.5) to 2 (when osc is .5);
amp.gain.value = 0.5; //oscillator between -0.5 and .5
lfo.frequency.value = 4; //happens 4 times/second (you knew that)
lfo.type = &quot;sine&quot;;
master.connect(c.destination); //keep the sound down
n.connect(master); //bufferSource
amp.connect(n.playbackRate); //***THE BUG starts here** playbackRate doesn&apos;t oscillate.
lfo.connect(amp); //lfo oscillates from -1 to 1, amp can make that larger or smaller.
//suppose we loaded a file in the buffer. Data generated below to demonstrate bug.
//generates a sort of sawtooth.
for (var i = 0; i &lt; 441; i++) d[i] = i / 441;
master.gain.value = 0.2;
n.buffer = b; //our generated buffer
n.loop = true; //loops so get continuous sound
n.start(0); //start the sound
lfo.start(0); //start vibrato</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>972351</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2014-01-27 00:15:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/15912715&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>972353</commentid>
    <comment_count>2</comment_count>
    <who name="Jason Custer">jscuster</who>
    <bug_when>2014-01-27 00:23:43 -0800</bug_when>
    <thetext>Some info not sticking. This is the web audio component, I am using Version 7.0.1 (9537.73.11, 538+) Sorry for the multiple mods.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>222306</attachid>
            <date>2014-01-27 00:14:44 -0800</date>
            <delta_ts>2014-01-27 00:14:44 -0800</delta_ts>
            <desc>html file with a similar script imbedded. When loaded, sound starts playing. When the bug is fixed, it will play with pitch oscillating.</desc>
            <filename>vibrato.html</filename>
            <type>text/plain</type>
            <size>623</size>
            <attacher name="Jason Custer">jscuster</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8dGl0bGU+VmlicmF0bzwvdGl0bGU+CjxzY3JpcHQgdHlwZT0idGV4dC9q
YXZhc2NyaXB0Ij4KdmFyIGMgPSB3aW5kb3cud2Via2l0QXVkaW9Db250ZXh0ID8gbmV3IHdlYmtp
dEF1ZGlvQ29udGV4dCgpIDogbmV3IEF1ZGlvQ29udGV4dCgpLApiPWMuY3JlYXRlQnVmZmVyKDEs
IDQ0MSwgNDQxMDApLApkPWIuZ2V0Q2hhbm5lbERhdGEoMCksCm49Yy5jcmVhdGVCdWZmZXJTb3Vy
Y2UoKSwKYW1wPWMuY3JlYXRlR2FpbigpLAptYXN0ZXIgPSBjLmNyZWF0ZUdhaW4oKSwKbGZvID0g
Yy5jcmVhdGVPc2NpbGxhdG9yKCk7Cm1hc3Rlci5jb25uZWN0KGMuZGVzdGluYXRpb24pOwpuLmNv
bm5lY3QobWFzdGVyKTsKYW1wLmNvbm5lY3Qobi5wbGF5YmFja1JhdGUpOwpsZm8uY29ubmVjdChh
bXApOwphbXAuZ2Fpbi52YWx1ZSA9IDAuMDU7Cmxmby5mcmVxdWVuY3kudmFsdWUgPSAyOwpsZm8u
dHlwZSA9ICJzaW5lIjsKZm9yICh2YXIgaSA9IDA7IGkgPCA0NDE7IGkrKykgZFtpXSA9IGkgLyA0
NDE7Cm1hc3Rlci5nYWluLnZhbHVlID0gMC4yOwpuLmJ1ZmZlciA9IGI7Cm4ubG9vcCA9IHRydWU7
Cm4uc3RhcnQoMCk7Cmxmby5zdGFydCgxMCk7Cjwvc2NyaXB0Pgo8L2hlYWQ+CjwvaHRtbD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>