Table of Contents

Class ConfigurationParser

Namespace
VAST.Codecs.MP3
Assembly
VAST.Common.dll

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

int

Channels

Gets the number of audio channels (1 for mono, 2 for stereo) parsed from the frame header.

public int Channels { get; }

Property Value

int

FrameDuration

Gets the frame duration in samples calculated from the frame header parameters.

public int FrameDuration { get; }

Property Value

int

FrameSize

Gets the frame size in bytes calculated from the frame header parameters.

public int FrameSize { get; }

Property Value

int

Layer

Gets the MPEG audio layer (1, 2, or 3) parsed from the frame header.

public int Layer { get; }

Property Value

int

SampleRate

Gets the sample rate in Hz parsed from the frame header.

public int SampleRate { get; }

Property Value

int

Version

Gets the MPEG audio version parsed from the frame header.

public ConfigurationParser.Version_t Version { get; }

Property Value

ConfigurationParser.Version_t

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

dataStream VersatileBufferStream

The 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

buffer byte[]

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

buffer byte[]

The buffer containing the MP3 frame header.

offset int

The offset within the buffer to start parsing.

length int

The 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

reader EndianBinaryReader

The 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

packet VersatileBuffer

The buffer containing the MP3 frame header.

offset int

The offset within the buffer to start parsing.

length int

The 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

dataStream VersatileBufferStream

The stream containing the MP3 frame header.

Returns

bool

True if parsing succeeded; otherwise, false.