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

Re: New proposal for fixing race conditions

From: Chris Wilson <cwilso@google.com>
Date: Fri, 26 Jul 2013 09:23:12 -0700
Message-ID: <CAJK2wqXTw5f6W1ruMmiTGerQpJ-vG55RMnwvo-OWrGCJpEAo0Q@mail.gmail.com>
To: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
Cc: Marcus Geelnard <mage@opera.com>, Ehsan Akhgari <ehsan.akhgari@gmail.com>, "Robert O'Callahan" <robert@ocallahan.org>, Jer Noble <jer.noble@apple.com>, Russell McClellan <russell@motu.com>, WG <public-audio@w3.org>
On Wed, Jul 24, 2013 at 4:06 AM, Jussi Kalliokoski <
jussi.kalliokoski@gmail.com> wrote:

> On Tue, Jul 23, 2013 at 11:10 PM, Chris Wilson <cwilso@google.com> wrote:
>
>> OK.  I want to load an audio file, perform some custom analysis on it
>> (e.g. determine average volume), perform some custom (offline) processing
>> on the buffer based on that analysis (e.g. soft limiting), and then play
>> the resulting buffer.
>>
> This is a symptom of another problem with the API. In this scenario your
> biggest problem with the API is far from the copy happening here, instead
> it is that the method for decoding audio has the wrong input and output for
> most cases. What the decodeAudioData assumes currently is that what you
> have is a binary buffer containing the encoded audio data and you want a
> high-level construct representing the audio data (an AudioBuffer) out of
> it. Your case (and a common case anyway), however, is that you have a URL
> to an audio resource and you want a list of Float32Arrays out. Why does
> decodeAudioData (async) return an AudioBuffer in the first place?
>

Hmm.  Well, the channels being handled as an array of Float32Arrays would
be less structurally obvious.  Since the it is resampled to the
AudioContext rate anyway, the meta data is less interesting - although I'd
ideally like our decoding to have more metadata expressing the internals,
rather than less (e.g. original sample rate, any tempo tags, etc.).
Received on Friday, 26 July 2013 16:23:39 UTC

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