W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2011

Re: WebAudio feedback and suggestions

From: Jonathan Baudanza <jon@jonb.org>
Date: Wed, 16 Nov 2011 13:56:39 -0800
Message-ID: <CAP26MZvoqRhTG3pZupo+tq2dd6yAC3Cn6q+aE5QotqFi_D0fjw@mail.gmail.com>
To: public-audio@w3.org
On Wed, Nov 16, 2011 at 1:43 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

> The callback function will still run on the JS main thread, right? (It
> needs to, to touch the AudioNode objects.) So you'll still glitch when the
> main thread is running some other script (or doing something else) at that
> exact moment.
> In ProcessedMediaStream I solved this problem by having the addInput
> method take a time parameter (relative to the progress of the output
> stream, sample-accurate) at which the input stream becomes enabled and
> unblocks.
I'm not familiar with ProcessedMediaStream, but it sounds like addInput()
performs the same function as noteOn(when) on AudioBufferSourceNode.

Scheduling sample accurate playback isn't a problem with the WebAudio
spec.  The problem is "scheduling the scheduling" of the playback.   For
some applications you may be able to do all the scheduling upfront.  If
you're scheduling sounds based on some real time interaction with the user
(music for example), it's not so simple.  This is where
context.callbackAtTime comes in.
Received on Wednesday, 16 November 2011 21:57:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:49:57 UTC