Class Opus
public static class Opus
- Inheritance
-
Opus
- Inherited Members
Fields
DefaultFrameDuration
public const float DefaultFrameDuration = 20
Field Value
MaxBitrate
public const int MaxBitrate = 510000
Field Value
MaxFrameDuration
public const float MaxFrameDuration = 120
Field Value
SamplingRate
public const int SamplingRate = 48000
Field Value
Methods
GetFrameBufferSize(int, PcmFormat, VoiceChannels)
Calculates the required buffer size, in bytes, for a PCM audio frame.
public static int GetFrameBufferSize(int samplesPerChannel, PcmFormat format, VoiceChannels channels)
Parameters
samplesPerChannelintThe number of samples per channel.
formatPcmFormatThe PCM format to use.
channelsVoiceChannelsThe number of channels to use.
Returns
- int
The size of the buffer, in bytes, required to store the audio frame for the given duration, format, and channel count.
GetMaxOpusFrameSize(float)
Calculates the maximum possible size, in bytes, of an Opus audio frame.
public static int GetMaxOpusFrameSize(float frameDuration)
Parameters
frameDurationfloatThe duration of the Opus frame, in milliseconds. Allowed values are 2.5, 5, 10, 20, 40, 60 and 120 (the last one is only allowed for Mono).
Returns
- int
The maximum number of bytes that an Opus frame of the specified duration can occupy.
GetSamplesPerChannel(float)
Calculates the number of samples per channel in an Opus audio frame.
public static int GetSamplesPerChannel(float frameDuration)
Parameters
frameDurationfloatFrame duration in milliseconds. Allowed values are 2.5, 5, 10, 20, 40, 60 and 120 (the last one is only allowed for Mono).