Re: decodeAudioBuffer, XHR and MIME headers

On 24 Jul 2013, at 23:07, "K. Gadd" <kg@luminance.org> wrote:

> Not to sidetrack, but 'streaming' is the key here. I've seen multiple mentions on this list (in particular re: the race condition/memcpy discussions) of the importance of being able to process large amounts of audio, and in that scenario having to download an entire 50MB of audio into a buffer before passing it into decodeAudioBuffer to decode all at once into another buffer is suboptimal. I said 'streaming' because being able to download and decode an MP3 in chunks of say 128kb at a time has lots of benefits - reduced memory usage, reduced latency before playback can begin, etc.

Streaming is the key here, but I cannot really understand why the MIME-type is important?

Almost every file is going to have an incomplete and/or useless MIME-type that will require sniffing anyhow. For useful (read, not audio/basic, or audio/L24) formats, you will only get the container type (audio/mp4, audio/ogg, audio/mpeg, audio/vnd.wave), and that should be trivial to sniff from the binary anyhow?

Hugs,
Jens Nockert

Received on Wednesday, 24 July 2013 21:19:50 UTC