Class ConfigurationParser
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
Properties
Band
Gets the audio bandwidth (sampling rate band) parsed from the TOC byte.
public ConfigurationParser.Band_t Band { get; }
Property Value
Channels
Gets the number of audio channels (1 for mono, 2 for stereo) parsed from the TOC byte.
public int Channels { get; }
Property Value
FrameDuration
Gets the total frame duration in 100-nanosecond units for all frames in the packet.
public long FrameDuration { get; }
Property Value
FrameSizes
Gets the list of individual frame sizes in bytes within the packet.
public List<int> FrameSizes { get; }
Property Value
FramesInPacket
Gets the number of Opus frames contained in the packet.
public int FramesInPacket { get; }
Property Value
IsValid
Gets a value indicating whether the parsed packet is valid and well-formed.
public bool IsValid { get; }
Property Value
PacketSize
Gets the total packet size in bytes, or -1 if not yet parsed.
public int PacketSize { get; }
Property Value
SampleRate
Gets the sample rate in Hz corresponding to the parsed bandwidth.
public int SampleRate { get; }
Property Value
Methods
Parse(EndianBinaryReader)
Parses an Opus packet header from an EndianBinaryReader.
public bool Parse(EndianBinaryReader reader)
Parameters
readerEndianBinaryReaderThe 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
packetVersatileBufferThe buffer containing the Opus packet.
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 Opus packet header from a VersatileBufferStream. The stream position is restored after parsing.
public bool Parse(VersatileBufferStream dataStream)
Parameters
dataStreamVersatileBufferStreamThe stream containing the Opus packet.
Returns
- bool
True if parsing succeeded; otherwise, false.