Interface IMp3FrameDecompressor
Interface for MP3 frame by frame decoder
public interface IMp3FrameDecompressor : IDisposable
- Inherited Members
Properties
OutputFormat
PCM format that we are converting into
WaveFormat OutputFormat { get; }
Property Value
Methods
DecompressFrame(Mp3Frame, byte[], int)
Decompress a single MP3 frame into the supplied byte buffer.
int DecompressFrame(Mp3Frame frame, byte[] dest, int destOffset)
Parameters
frameMp3FrameFrame to decompress
destbyte[]Output buffer — must be large enough to hold one frame's PCM output from
destOffsetonwardsdestOffsetintOffset within output buffer
Returns
- int
Bytes written to output buffer
Remarks
Prefer the DecompressFrame(Mp3Frame, Span<byte>) overload where possible. This overload is retained for backward compatibility with existing implementations (including external decoders such as NLayer).
DecompressFrame(Mp3Frame, Span<byte>)
Decompress a single MP3 frame into the supplied span.
int DecompressFrame(Mp3Frame frame, Span<byte> dest)
Parameters
frameMp3FrameFrame to decompress
destSpan<byte>Output span — must be large enough to hold one frame's PCM output
Returns
- int
Bytes written to
dest
Remarks
The default implementation routes through DecompressFrame(Mp3Frame, byte[], int) via an ArrayPool<T>-backed byte buffer, so existing implementations written against the byte[] overload continue to work unchanged. Implementations that can write directly into a span should override this method to avoid the intermediate copy.
Reset()
Tell the decoder that we have repositioned
void Reset()