finishDecoded

suspend fun finishDecoded(abort: () -> Boolean = { false }): Int

Pushes the last of the decoded audio out of the DSP stages and into the ring.

The tempo stage holds up to about 60 ms it cannot place without the audio that comes after it, and at the end of a stream nothing comes after it. Until this call existed that audio was discarded by the next reset, so every clip played at a non-1x speed lost its final fragment and short clips lost an audible share of themselves.

Call it once, after the decoder is drained and every decoded buffer has been submitted, and before drain. Belongs to the feeder, like submitDecoded: it runs the same pipeline and the same timestamp arithmetic, and nothing else may touch either.

Return

sample frames handed to the ring, zero when the stages were already empty.

Parameters

abort

polled while the ring is full, exactly as submitDecoded polls it.

Throws

carrying PlaybackError.DecoderFailed when the rate conversion's tail would need more than 4 Mi float values.