Class ConfigurationParser
Provides parsing functionality for MP3 (MPEG Audio Layer I/II/III) frame headers.
public class ConfigurationParser
- Inheritance
-
ConfigurationParser
- Inherited Members
Constructors
ConfigurationParser()
Initializes a new instance of the ConfigurationParser class.
public ConfigurationParser()
Properties
Bitrate
Gets the bitrate in bits per second parsed from the frame header.
public int Bitrate { get; }
Property Value
Channels
Gets the number of audio channels (1 for mono, 2 for stereo) parsed from the frame header.
public int Channels { get; }
Property Value
FrameDuration
Gets the frame duration in samples calculated from the frame header parameters.
public int FrameDuration { get; }
Property Value
FrameSize
Gets the frame size in bytes calculated from the frame header parameters.
public int FrameSize { get; }
Property Value
Layer
Gets the MPEG audio layer (1, 2, or 3) parsed from the frame header.
public int Layer { get; }
Property Value
SampleRate
Gets the sample rate in Hz parsed from the frame header.
public int SampleRate { get; }
Property Value
Version
Gets the MPEG audio version parsed from the frame header.
public ConfigurationParser.Version_t Version { get; }
Property Value
Methods
FindFrameStart(VersatileBufferStream)
Searches for the start of an MP3 frame (sync word 0xFFE0) in the stream. If found, the stream is positioned at the start of the frame.
public bool FindFrameStart(VersatileBufferStream dataStream)
Parameters
dataStreamVersatileBufferStreamThe stream to search.
Returns
- bool
True if a frame start was found; otherwise, false.
Parse(byte[])
Parses an MP3 frame header from a byte array.
public bool Parse(byte[] buffer)
Parameters
bufferbyte[]The buffer containing the MP3 frame header.
Returns
- bool
True if parsing succeeded; otherwise, false.
Parse(byte[], int, int)
Parses an MP3 frame header from a portion of a byte array.
public bool Parse(byte[] buffer, int offset, int length)
Parameters
bufferbyte[]The buffer containing the MP3 frame header.
offsetintThe offset within the buffer to start parsing.
lengthintThe number of bytes available for parsing.
Returns
- bool
True if parsing succeeded; otherwise, false.
Parse(EndianBinaryReader)
Parses an MP3 frame header from an EndianBinaryReader.
public bool Parse(EndianBinaryReader reader)
Parameters
readerEndianBinaryReaderThe reader positioned at the start of the MP3 frame header.
Returns
- bool
True if parsing succeeded; otherwise, false.
Parse(VersatileBuffer, int, int)
Parses an MP3 frame header from a VersatileBuffer.
public bool Parse(VersatileBuffer packet, int offset, int length)
Parameters
packetVersatileBufferThe buffer containing the MP3 frame header.
offsetintThe offset within the buffer to start parsing.
lengthintThe number of bytes available for parsing.
Returns
- bool
True if parsing succeeded; otherwise, false.
Parse(VersatileBufferStream)
Parses an MP3 frame header from a VersatileBufferStream. The stream position is restored after parsing.
public bool Parse(VersatileBufferStream dataStream)
Parameters
dataStreamVersatileBufferStreamThe stream containing the MP3 frame header.
Returns
- bool
True if parsing succeeded; otherwise, false.