AudioStore
A browser audio store that turns complete tracks into small IndexedDB records, then stitches only the next few seconds back together for memory-efficient, sample-accurate playback.
For the full demo, make sure your volume is up and your phone isn’t muted or on silent.
Stream the session
Preparing a twelve-stem session for IndexedDB.
Decoded audio held for playback
Estimated from the session’s actual sample rates, channel counts, and durations.
— less decoded audio held for playback. This excludes browser and application overhead.
Small windows, not whole files
AudioStore accepts decoded AudioBuffer instances, breaks them into fixed-duration chunks, and saves them in IndexedDB. Calling code still asks for an arbitrary range; the store fetches the necessary records and returns one seamless buffer.
That matters when several long stems are playing together. Decoded audio is raw PCM, so it can consume tens of MiB per minute per stereo stem—far more than the compressed file. AudioStore keeps the playback buffer bounded instead of retaining every full track in browser memory.
The mixer above uses StreamCoordinator to keep independent stem streamers aligned. As each one approaches the end of its current buffer, it requests and schedules the next chunk before the listener gets there.
The path through the browser
- Decode once.Fetch an asset and decode it into an
AudioBuffer. - Store in pieces.Write fixed five-second channel data records to IndexedDB.
- Read just in time.Stitch the next range into a fresh buffer and schedule it precisely.