[Webkit-unassigned] [Bug 127674] New: bufferSource's playbackRate param not controlled by oscillator (as in spec).

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 27 00:17:19 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=127674

           Summary: bufferSource's playbackRate param not controlled by
                    oscillator (as in spec).
           Product: WebKit
           Version: 312.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.9
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Accessibility
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jscuster at gmail.com
                CC: webkit-bug-importer at group.apple.com


Created an attachment (id=222306)
 --> (https://bugs.webkit.org/attachment.cgi?id=222306&action=review)
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 < gain < 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'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 = "sine";
master.connect(c.destination); //keep the sound down
n.connect(master); //bufferSource
amp.connect(n.playbackRate); //***THE BUG starts here** playbackRate doesn'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 < 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

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list