klyn.audio.WaveReader.readFrames
method
public readFrames(maximum as Long = 4096l) as AudioClip
Description

Decodes at most maximum frames, with an upper bound of 65536 per call. Returns an empty clip at EOF or for maximum=0. No read-ahead task is started; callers can cancel between reads and retain or discard individual blocks. The frame cursor advances only after a complete block decodes successfully.

Parameters
ParameterDescription
maximumNon-negative requested frame count, capped at 65536.
Returns

Independent interleaved PCM at the original rate/channel count.

Throws
  • ValueException for negative maximum or non-finite PCM.
  • IOException if closed, truncated after opening, or reading fails.
Example

block = reader.readFrames(4096l)