We should rewrite the decoding logic to create some form of pipeline that takes a stream as input and outputs the sound buffers. Most importantly, the decoder be ignorant of how much is being read, so that they can be reused for both stream-reading and file-reading.