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

Re: decodeAudioData on partial ArrayBuffers

From: Chris Rogers <crogers@google.com>
Date: Wed, 25 Jan 2012 11:58:32 -0800
Message-ID: <CA+EzO0mRC2PLzKW11rjEinEuyBLpEQeqsAPKVOkNA8HL8S0keA@mail.gmail.com>
To: Robert Clouth <rob.clouth@gmail.com>
Cc: public-audio@w3.org
Hi Rob,

It's a bit tricky to distinguish the case where you're trying to decode a
corrupt audio file versus your use case, where it's ok to just decode up
until the first bad frame.  Also, even if we did read up to the first bad
frame, then we're still not handling the case where we need to decode a
range in the middle of the file (not starting at the beginning).  So, the
decodeAudioData() method is not really designed or suited for this general
case.  But, of course there should be a way to do it.  An interesting new
specification is the "Media Fragments" API:
http://www.w3.org/TR/media-frags/

It can specify a time range within a larger audio resource, so I think we
should leverage that in order to extract and decode "regions" from large
media files.

Chris

On Tue, Jan 24, 2012 at 9:11 AM, Robert Clouth <rob.clouth@gmail.com> wrote:

> Hello,
>
> I'm requesting parts of mp3s using request.setRequestHeader("Range",
> "bytes=0-500000");
> However, decodeAudioData doesn't seem to work on partial ArrayBuffers. Am
> I doing something wrong? Why does it not just read up until the first bad
> frame?
>
> Cheers,
>
> Rob Clouth
>
Received on Wednesday, 25 January 2012 19:59:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 January 2012 19:59:03 GMT