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

Re: Preparing the vote on the data race issue

From: Robert O'Callahan <robert@ocallahan.org>
Date: Wed, 31 Jul 2013 11:45:00 +1200
Message-ID: <CAOp6jLZP2msBrNqKavTZkj0+5Ju6J351tzmy--AZUeWKjy955Q@mail.gmail.com>
To: Jer Noble <jer.noble@apple.com>
Cc: Ehsan Akhgari <ehsan.akhgari@gmail.com>, Olivier Thereaux <Olivier.Thereaux@bbc.co.uk>, Joseph Berkovitz <joe@noteflight.com>, WG <public-audio@w3.org>
On Wed, Jul 31, 2013 at 11:24 AM, Jer Noble <jer.noble@apple.com> wrote:

> On Jul 30, 2013, at 4:08 PM, Robert O'Callahan <robert@ocallahan.org>
> wrote:
>
> What does it mean for the AudioBuffer.channels array to be "read-only"? I
> don't think that makes sense actually. I'd replace this with
> getChannel(channelNum) instead.
>
>
> [1] "Arrays can also be designated as being read only. User code cannot
> modify the values of read only array elements. If an array is read only,
> then it is also implicitly fixed length."
>

Oops, right.


>
> The AudioBuffer constructor that takes an array (or sequence) of
> Float32Arrays needs to specify that it copies the contents of those arrays
> (I believe that's your intent?).
>
>
> Yes, as Ehsan pointed out, this should be a sequence, which requires that
> the contents are passed by value[2], not by reference.
>

Yes, but you still need to specify that the contents of the Float32Arrays
are copied.


> Are they fresh AudioBuffers every time an event fires, or do values get
> reused?
>
>
> Implementation detail.
>

I don't think so. Scripts can observe whether the AudioBuffer passed in an
event is the same as AudioBuffers previously passed to the event, by
storing a reference to the previous AudioBuffers and comparing references.
Even worse, someone might do something like
scriptProcessorNode.onprocess = function (event) {
bufferList.push(event.inputBuffer); };
in which case it definitely matters whether AudioBuffers are being reused!


>
> And what is the state of the initial outputBuffer object?
>
>
> What is the state now?
>

Not super well specified. I think you want to say it's an empty (zero)
buffer with numberOfOutputChannels channels each of length bufferSize (both
values taken from createScriptProcessor), and "not currently in use". (Does
it go into the NO_MODIFICATION_ALLOWED_ERR state when the event handler
returns?)

Rob
-- 
Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w  *
*
Received on Tuesday, 30 July 2013 23:45:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:10 UTC