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

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 UTC