W3C home > Mailing lists > Public > public-audio@w3.org > January to March 2012

Re: Some questions about JavaScriptNode

From: Raymond Toy <rtoy@google.com>
Date: Mon, 19 Mar 2012 12:51:14 -0700
Message-ID: <CAE3TgXHzpfO_r32wRo+br5FCtkdVzMZPHj=1uDVZsJozL7P-ig@mail.gmail.com>
To: Yves Raimond <Yves.Raimond@bbc.co.uk>
Cc: public-audio@w3.org
On Mon, Mar 19, 2012 at 4:34 AM, Yves Raimond <Yves.Raimond@bbc.co.uk>wrote:

> Hello!
> I was recently wondering about a few aspects of JavascriptNode. I was
> wondering why, in Chrome Linux, every demo involving sound generated by a
> JavascriptNode was stuttering, e.g. [0]. It does look like the frequency of
> the stutter changes as the size of the node buffer changes, which seems to
> indicate that each silence is actually the time it takes to run the process
> code. Demos involving just reading from a wavetable don't seem to suffer
> from that. Of course a way around that would be to have an optimised
> oscillator node, which has been discussed before on this mailing list.

I believe this is an artifact of how chrome linux handles audio.  If you
change kBufferSize to 2048, the tones will come out as expected.   There is
an internal buffer of size 2048 and this causes the stuttering you see with
a JavaScriptNode.  You need to generate at least 2048 samples.

Received on Monday, 19 March 2012 19:51:43 UTC

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