Documentation
¶
Index ¶
- Constants
- Variables
- func GetOutputBuffSize(rate int, channels int) int
- func Version() string
- type Application
- type Decoder
- func (e *Decoder) Channels() int
- func (e *Decoder) Ctl(macro Macro[Decoder]) error
- func (e *Decoder) Decode(data []byte, pcm []int16, decodeFec bool) (int, error)
- func (e *Decoder) DecodeFloat(data []byte, pcm []float32, decodeFec bool) (int, error)
- func (e *Decoder) Destroy()
- func (e *Decoder) Init(sampleRate int, channels int) error
- func (e *Decoder) SampleRate() (int, error)
- type Encoder
- func (e *Encoder) Channels() int
- func (e *Encoder) Ctl(macro Macro[Encoder]) error
- func (e *Encoder) Destroy()
- func (e *Encoder) Encode(pcm []int16, data []byte) (int, error)
- func (e *Encoder) EncodeFloat(pcm []float32, data []byte) (int, error)
- func (e *Encoder) Init(sampleRate int, channels int, application Application) error
- func (e *Encoder) SampleRate() (int, error)
- type Error
- type Macro
Constants ¶
View Source
const FrameSize = 20
Variables ¶
View Source
var ( ErrEncoderNotInitialized = errors.New("audio encoder not initialized") ErrEncoderAlreadyInitialized = errors.New("audio encoder already initialized") ErrDecoderNotInitialized = errors.New("audio decoder not initialized") ErrDecoderAlreadyInitialized = errors.New("audio decoder already initialized") ErrRepacketizerNotInitialized = errors.New("audio repacketizer not initialized") ErrRepacketizerAlreadyInitialized = errors.New("audio repacketizer already initialized") )
Functions ¶
func GetOutputBuffSize ¶
Types ¶
type Application ¶
type Application int
const ( ApplicationVoip Application = C.OPUS_APPLICATION_VOIP ApplicationAudio Application = C.OPUS_APPLICATION_AUDIO ApplicationRestrictedLowdelay Application = C.OPUS_APPLICATION_RESTRICTED_LOWDELAY )
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func (*Decoder) DecodeFloat ¶
func (*Decoder) SampleRate ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder(sampleRate int, channels int, application Application) (*Encoder, error)
func (*Encoder) EncodeFloat ¶
func (*Encoder) Init ¶
func (e *Encoder) Init(sampleRate int, channels int, application Application) error
func (*Encoder) SampleRate ¶
type Error ¶
type Error int
const ( ErrOK Error = C.OPUS_OK ErrBadArg Error = C.OPUS_BAD_ARG ErrBufferTooSmall Error = C.OPUS_BUFFER_TOO_SMALL ErrInternalError Error = C.OPUS_INTERNAL_ERROR ErrInvalidPacket Error = C.OPUS_INVALID_PACKET ErrUnimplemented Error = C.OPUS_UNIMPLEMENTED ErrInvalidState Error = C.OPUS_INVALID_STATE ErrAllocFail Error = C.OPUS_ALLOC_FAIL )
type Macro ¶
func GetDecoderSamplerRte ¶
func GetEncoderSampleRate ¶
func SetBitrate ¶
func SetComplexity ¶
func SetForceChannels ¶
Click to show internal directories.
Click to hide internal directories.