Re: memory footprint of AudioBuffer data copies

On Jul 30, 2013, at 3:47 PM, Robert O'Callahan <robert@ocallahan.org> wrote:

> On Wed, Jul 31, 2013 at 3:18 AM, Jer Noble <jer.noble@apple.com> wrote:
> What's more, you probably wouldn't want to synthesize the AudioBuffers entirely in advance either.  You'd synthesize a few chunks, schedule them for their specific times, and as they finished playing, you would synthesize additional chunks.  You might even implement a ringbuffer structure, so that later chunks imposed no additional memory or GC costs.  In that way, both the 2x chunk size would be mitigated, as would the overall outstanding buffer size would be limited to the size of your ringbuffer.
> 
> Why would you do this instead of just scheduling multiple AudioBufferSourceNodes?
> 

I guess I don’t understand your question: you /would/ schedule multiple AudioBufferSourceNodes.  Each with it’s own “chunk” of decoded audio data.

-Jer

Received on Tuesday, 30 July 2013 22:49:58 UTC