read
Decodes up to frames frames into the start of output, interleaved by channel, and returns how many frames were written. Returns fewer than frames only at the end of the file, and 0 once the end has been reached.
Allocates nothing beyond pinning output for the call, so it is safe on the audio thread.
Throws
if the stream is closed.