[Earwurm] Support audio sprites #34
Labels
✨ Feature
New addition to the codebase (feature, utility, component, etc.)
🧐 Question
Further information is requested
An "audio sprite" is a way to combine multiple sounds into a single file. This would result in a single larger file... but would also reduce total network requests to
1
. Depending on your situation, an audio sprite might be efficient.In order to support this, a
Stack
would have to accept arange
that it "restricts a sound to".Something like:
Not sure yet if we are able to cut up a
AudioBuffer
to that exactrange
, or if we would have to carefully check start/end times whenever aSound
is played... this would require investigation.There are a few different ways I can imagine implementing this:
I probably prefer
Option 2
. Either way, we need to iterate over eachsprite > range
and instantiate a newStack
.I worry that this pattern won't fit well with the current implementation:
Stack
"fetch and decode" upon.prepare()
?.prepare()
is called on different "ranges" before a "cache" has been made?fetch + decode
ahead of time, and pass the "clipped buffer" intonew Stack()
?Stack
to accept abuffer
instead of apath
.stack
then need to retain thatbuffer
in memory?Ultimately, my concerns give me pause over implementing this feature. The current design of
Earwurm
might not be suitable for "audio sprites". I think we would have to make pretty drastic changes:The text was updated successfully, but these errors were encountered: