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.

0stems in IndexedDB
5sper stored chunk
~10sheld for playback
playing nowprefetched and scheduledfive-second playback windows

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

  1. Decode once.Fetch an asset and decode it into an AudioBuffer.
  2. Store in pieces.Write fixed five-second channel data records to IndexedDB.
  3. Read just in time.Stitch the next range into a fresh buffer and schedule it precisely.
+