Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Auto/default setting OpusAuto = int(C.OPUS_AUTO) // Maximum bitrate BitrateMax = int(C.OPUS_BITRATE_MAX) )
View Source
const ( // Optimize encoding for VoIP AppVoIP = Application(C.OPUS_APPLICATION_VOIP) // Optimize encoding for non-voice signals like music AppAudio = Application(C.OPUS_APPLICATION_AUDIO) // Optimize encoding for low latency applications AppRestrictedLowdelay = Application(C.OPUS_APPLICATION_RESTRICTED_LOWDELAY) )
View Source
const ( // Signal being encoded is voice SignalVoice = SignalType(C.OPUS_SIGNAL_VOICE) // Signal being encoded is music SignalMusic = SignalType(C.OPUS_SIGNAL_MUSIC) )
View Source
const ( // 4 kHz bandpass BandwidthNarrowband = BandwidthType(C.OPUS_BANDWIDTH_NARROWBAND) // 6 kHz bandpass BandwidthMediumband = BandwidthType(C.OPUS_BANDWIDTH_MEDIUMBAND) // 8 kHz bandpass BandwidthWideband = BandwidthType(C.OPUS_BANDWIDTH_WIDEBAND) // 12 kHz bandpass BandwidthSuperwideband = BandwidthType(C.OPUS_BANDWIDTH_SUPERWIDEBAND) // 20 kHz bandpass BandwidthFullband = BandwidthType(C.OPUS_BANDWIDTH_FULLBAND) )
View Source
const ( // Select frame size from the argument (default) FramesizeArg = FrameSizeType(C.OPUS_FRAMESIZE_ARG) // Use 2.5 ms frames Framesize2Dot5Ms = FrameSizeType(C.OPUS_FRAMESIZE_2_5_MS) // Use 5 ms frames Framesize5Ms = FrameSizeType(C.OPUS_FRAMESIZE_5_MS) // Use 10 ms frames Framesize10Ms = FrameSizeType(C.OPUS_FRAMESIZE_10_MS) // Use 20 ms frames Framesize20Ms = FrameSizeType(C.OPUS_FRAMESIZE_20_MS) // Use 40 ms frames Framesize40Ms = FrameSizeType(C.OPUS_FRAMESIZE_40_MS) // Use 60 ms frames Framesize60Ms = FrameSizeType(C.OPUS_FRAMESIZE_60_MS) // Use 80 ms frames Framesize80Ms = FrameSizeType(C.OPUS_FRAMESIZE_80_MS) // Use 100 ms frames Framesize100Ms = FrameSizeType(C.OPUS_FRAMESIZE_100_MS) // Use 120 ms frames Framesize120Ms = FrameSizeType(C.OPUS_FRAMESIZE_120_MS) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpusDecoder ¶
type OpusDecoder struct { // config OpusDecoderConfig // contains filtered or unexported fields }
Opus Decoder
func CreateOpusDecoder ¶
func CreateOpusDecoder(config *OpusDecoderConfig) (dec *OpusDecoder, err error)
Create Opus Decoder
type OpusDecoderConfig ¶
type OpusDecoderConfig struct { // Sampling rate of input signal (Hz). // This must be one of 8000, 12000, 16000, 24000, or 48000. SampleRate int // Number of channels in input signal. MaxChannels int // Decoder gain adjustment. Gain int // Enable inband forward error correction (FEC). EnableInbandFEC bool }
Opus Decoder Config
type OpusEncoder ¶
type OpusEncoder struct { // config OpusEncoderConfig // contains filtered or unexported fields }
Opus Encoder
func CreateOpusEncoder ¶
func CreateOpusEncoder(config *OpusEncoderConfig) (enc *OpusEncoder, err error)
Create Opus Encoder
type OpusEncoderConfig ¶
type OpusEncoderConfig struct { // Sampling rate of input signal (Hz). // This must be one of 8000, 12000, 16000, 24000, or 48000. SampleRate int // Number of channels in input signal. MaxChannels int // Encode mode. Application Application // Enable discontinuous transmission (DTX). EnableDTX bool // Enable inband forward error correction (FEC). EnableInbandFEC bool // Disable almost all use of prediction. DisablePrediction bool // Disable variable bitrate (VBR). DisableVBR bool // Disable constrained VBR. DisableConstrainedVBR bool // Disable the use of phase inversion for intensity stereo. DisablePhaseInversion bool // Rates from 500 to 512000 bits per second are meaningful, // as well as the special values BitrateAuto and BitrateMax. Bitrate int // Complexity configuration, a value in the range 0-10. Complexity int // The maximum bandpass that the encoder will select automatically. MaxBandwidth BandwidthType // Encoder's bandpass to a specific value. Bandwidth BandwidthType // Expected packet loss percentage. PacketLossPercent int // The encoder's use of variable duration frames. FrameDuration FrameSizeType // The type of signal being encoded. SignalType SignalType // Force mono or stereo. ForceChannels int // The depth of signal being encoded. LSBDepth int }
Opus Encoder Config
Click to show internal directories.
Click to hide internal directories.