Table of Contents

Class ConfigurationParser

Namespace
VAST.Codecs.Opus
Assembly
VAST.Common.dll

Provides parsing functionality for Opus audio packet headers and frame structure.

public class ConfigurationParser
Inheritance
ConfigurationParser
Inherited Members

Constructors

ConfigurationParser()

Initializes a new instance of the ConfigurationParser class.

public ConfigurationParser()

Fields

MaximumPacketDuration

The maximum allowed packet duration in 100-nanosecond units (120 ms).

public const long MaximumPacketDuration = 1200000

Field Value

long

Properties

Band

Gets the audio bandwidth (sampling rate band) parsed from the TOC byte.

public ConfigurationParser.Band_t Band { get; }

Property Value

ConfigurationParser.Band_t

Channels

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

public int Channels { get; }

Property Value

int

FrameDuration

Gets the total frame duration in 100-nanosecond units for all frames in the packet.

public long FrameDuration { get; }

Property Value

long

FrameSizes

Gets the list of individual frame sizes in bytes within the packet.

public List<int> FrameSizes { get; }

Property Value

List<int>

FramesInPacket

Gets the number of Opus frames contained in the packet.

public int FramesInPacket { get; }

Property Value

int

IsValid

Gets a value indicating whether the parsed packet is valid and well-formed.

public bool IsValid { get; }

Property Value

bool

PacketSize

Gets the total packet size in bytes, or -1 if not yet parsed.

public int PacketSize { get; }

Property Value

int

SampleRate

Gets the sample rate in Hz corresponding to the parsed bandwidth.

public int SampleRate { get; }

Property Value

int

Methods

Parse(EndianBinaryReader)

Parses an Opus packet header from an EndianBinaryReader.

public bool Parse(EndianBinaryReader reader)

Parameters

reader EndianBinaryReader

The reader positioned at the start of the Opus packet.

Returns

bool

True if parsing succeeded; otherwise, false.

Parse(VersatileBuffer, int, int)

Parses an Opus packet header from a VersatileBuffer.

public bool Parse(VersatileBuffer packet, int offset, int length)

Parameters

packet VersatileBuffer

The buffer containing the Opus packet.

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 Opus packet header from a VersatileBufferStream. The stream position is restored after parsing.

public bool Parse(VersatileBufferStream dataStream)

Parameters

dataStream VersatileBufferStream

The stream containing the Opus packet.

Returns

bool

True if parsing succeeded; otherwise, false.