W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2012

Re: [Bug 17415] (JSWorkers): JavaScriptAudioNode processing in workers

From: Matt Diamond <mdiamond@jhu.edu>
Date: Wed, 11 Jul 2012 11:11:54 -0700
Message-ID: <CADdpXtvgC2R8MKz-1zr3wH_ZQr4OE5LVe9O_BcXak_Rqb-2J1w@mail.gmail.com>
To: Chris Wilson <cwilso@google.com>
Cc: bugzilla@jessica.w3.org, public-audio@w3.org
It's also easy to create a JavaScriptAudioNode that simply writes random
samples to the output buffers.

On Wed, Jul 11, 2012 at 9:41 AM, Chris Wilson <cwilso@google.com> wrote:

> White noise doesn't benefit from the anti-aliasing done for periodic
> waveforms, and it's actually quite easy to generate:
>
> var lengthInSamples =  2 * audioContext.sampleRate;  // 2 = 2 second long
> buffer.  Arbitrary.
> var noiseBuffer = audioContext.createBuffer(1, lengthInSamples,
> audioContext.sampleRate);
> var bufferData = noiseBuffer.getChannelData(0);
> for (var i = 0; i < lengthInSamples; ++i) {
>     bufferData[i] = (2*Math.random() - 1.0);  // -1 to +1 range
> }
>
>
>
> On Wed, Jul 11, 2012 at 8:39 AM, <bugzilla@jessica.w3.org> wrote:
>
>> https://www.w3.org/Bugs/Public/show_bug.cgi?id=17415
>>
>> --- Comment #49 from Grant Galitz <grantgalitz@gmail.com> 2012-07-11
>> 15:39:09 UTC ---
>> (In reply to comment #48)
>> > Hi Grant,
>> >
>> > (In reply to comment #44)
>> > > A bit off topic, but could we add nodes that generate specific
>> waveforms? Like
>> > > a sine/triangle/square/sawtooth/LSFR White Noise generator node?
>> >
>> > I think you are looking for
>> >
>> https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Oscillator
>> >
>> > Ideally, if you have any comment not related to a specific issue,
>> discussion on
>> > public-audio@w3.org is a better idea than hijacking the comment thread
>> ;)
>>
>> Oh wow, I never noticed you had that implemented already. I'm wondering
>> where
>> the white noise osc is?
>>
>> --
>> Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
>> ------- You are receiving this mail because: -------
>> You are on the CC list for the bug.
>>
>>
>
Received on Wednesday, 11 July 2012 18:12:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 11 July 2012 18:12:26 GMT