The OpenD Programming Language

MP3Decoder.frameSamples

Returns the current frame, as prepared by decodeNextFrame, in signed 16 bit (short[]) format.

This will allocate the buffer on first use, then continue reusing it for the duration of the MP3Decoder instance's lifetime, meaning it will not allocate again in the loop, but you should not keep a reference to the array because its contents will be overwritten as you continue calling decodeNextFrame.

Is you want something that never allocates, see frameSamplesFloat.

Please note that you MUST call decodeNextFrame first.

class MP3Decoder
@property nothrow
short[]
frameSamples
()

See Also

Meta

History

This was @nogc until November 20, 2022. It now lazily allocates the buffer if needed. If you want something nogc, use frameSamplesFloat and convert it yourself.