Large AudioBuffers in Web Audio API

Using the Web Audio API, how should I access the data of an audio file
longer than a minute?

>From the current specification on AudioBuffers at
http://chromium.googlecode.com/svn/trunk/samples/audio/specification/specification.html#AudioBuffer-section:

> Typically, it would be expected that the length of the PCM data would be
> fairly short (usually somewhat less than a minute). For longer sounds,
> such as music soundtracks, streaming should be used with the audio
> element and MediaElementAudioSourceNode.

I can use AudioBuffers in conjunction with JavaScriptAudioNodes to
manipulate the audio data, but I don't see a way to do this with a
MediaElementAudioSourceNode. Let's say I wish to play an MP3 file of a
typical 3 minute long song backwards. How should I accomplish this?
The API discourages me from loading the song into an AudioBuffer due
to it's length, but this seems to be the only way to directly access
and manipulate the audio data.

For comparison, with Flash and ActionScript 3, I can load an MP3 as a
Sound object and use the "extract" method to get a subset of the audio
data: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#extract()

- Ryan

Received on Monday, 28 February 2011 15:52:46 UTC