Optional Readonlylengthtotal frames, or undefined for a source with no end (a chip tune that never finishes)
Readonlysamplewrites up to count frames at start of both buffers and returns how many it wrote; fewer than asked means the source ended
makes the next read return frames from this position
Audio that is produced as it is played instead of decoded up front: a tracker, a chip player, a synthesiser. The consumer pulls frames in order; it can also ask for a different position, which a stateful source answers by skipping or rewinding as it can.