Re: Web Audio API ambient drone

Hmm.  If there is a perceptible looping effect, that's broken and should be
fixed.  (I used looped noise in the web audio vocoder (
webaudiovocoder.appspot.com, needs Chrome Dev channel or better), and never
noticed a problem.)  If you happen to run across it again, could you
forward me a repro case?

-C


On Sun, Jul 15, 2012 at 1:06 PM, Matt Diamond <mdiamond@jhu.edu> wrote:

> Thanks for the tip! An earlier version of this did in fact use
> pre-computed noise buffers, but I felt there was a vaguely perceptible
> "looping" effect because of the looping noise sample (it was a cool effect
> though). Another reason was that I was presenting a version of this script
> at a meetup, and felt like utilizing a JavaScriptAudioNode for real-time
> noise generation would be more interesting to demonstrate... but yes, it
> certainly takes a bit of a toll, and running a bunch of AudioBufferSource
> nodes would probably be much less taxing.
>
> Still, I'm pretty impressed that the API is able to handle so much, even
> if it's only on higher-end machines (I'm running it on a year-old MacBook
> Pro).
>
> Matt
>
>
> On Sun, Jul 15, 2012 at 8:03 AM, Chris Wilson <cwilso@google.com> wrote:
>
>> Hey Matt-
>>
>> Neat!  I like the apparent pitch generated by bandpass filter.
>>
>> One comment - instead of continually generating noise via
>> JavaScriptAudioNodes, you'd probably find it much more performant to
>> pre-generate a couple of seconds (to avoid any detectable periodicity) of
>> noise in a Buffer and playing it as an AudioNode.  That would probably be a
>> bit more performant than continually calling Math.random for each sample.
>>
>> var lengthInSamples =  2 * audioContext.sampleRate;
>> 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);
>>  }
>>
>> On Sat, Jul 14, 2012 at 12:26 PM, Matt Diamond <mdiamond@jhu.edu> wrote:
>>
>>> Hey all,
>>>
>>> Put together a little experiment in synthesizing an ambient sound
>>> texture using the Web Audio API:
>>>
>>> http://matt-diamond.com/drone.html
>>>
>>> Matt
>>>
>>
>>
>

Received on Monday, 16 July 2012 16:49:54 UTC