Documentation
¶
Overview ¶
Package silk provides a Silk coder
Index ¶
- type Bandwidth
- type Decoder
- func (d *Decoder) Decode(in []byte, out []float32, isStereo bool, nanoseconds int, bandwidth Bandwidth) error
- func (d *Decoder) DecodePLC(out []float32, isStereo bool, outputChannelCount int, nanoseconds int, ...) error
- func (d *Decoder) DecodeWithRange(rangeDecoder *rangecoding.Decoder, out []float32, isStereo bool, ...) error
- func (d *Decoder) DecodeWithRangeToChannels(rangeDecoder *rangecoding.Decoder, out []float32, isStereo bool, ...) error
- type Encoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bandwidth ¶
type Bandwidth byte
Bandwidth for Silk can be NB (narrowband) MB (medium-band) or WB (wideband).
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder maintains the state needed to decode a stream of Silk frames.
func (*Decoder) Decode ¶
func (d *Decoder) Decode( in []byte, out []float32, isStereo bool, nanoseconds int, bandwidth Bandwidth, ) error
Decode decodes one SILK frame of mono or stereo audio. https://datatracker.ietf.org/doc/html/rfc6716#section-4.2.1
func (*Decoder) DecodePLC ¶
func (d *Decoder) DecodePLC( out []float32, isStereo bool, outputChannelCount int, nanoseconds int, bandwidth Bandwidth, ) error
DecodePLC conceals a missing SILK packet while matching the channel count selected by the outer Opus decoder.
func (*Decoder) DecodeWithRange ¶
func (d *Decoder) DecodeWithRange( rangeDecoder *rangecoding.Decoder, out []float32, isStereo bool, nanoseconds int, bandwidth Bandwidth, ) error
DecodeWithRange decodes one SILK frame from an Opus range decoder shared with the CELT layer, as required by RFC 6716 hybrid packets.
func (*Decoder) DecodeWithRangeToChannels ¶
func (d *Decoder) DecodeWithRangeToChannels( rangeDecoder *rangecoding.Decoder, out []float32, isStereo bool, outputChannelCount int, nanoseconds int, bandwidth Bandwidth, ) error
DecodeWithRangeToChannels decodes one SILK frame while matching the API output channel count selected by the outer Opus decoder.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder quantizes and range-encodes a single SILK channel. It is the counterpart to Decoder and is built up one stage at a time.
State fields match the corresponding Decoder fields and use the same reset values so the encoder and decoder stay in sync across an uncoded frame.
func NewEncoder ¶
func NewEncoder() Encoder
NewEncoder creates a SILK Encoder with its prediction state reset.
func (*Encoder) Encode ¶
Encode returns one mono 20, 40, or 60 ms SILK payload without the Opus TOC. Multi-unit packets share one range stream and preserve prediction state across units and calls. Invalid unit counts return nil before state changes.
func (*Encoder) SetUseInterpolatedNLSFs ¶
SetUseInterpolatedNLSFs enables or disables the NLSF interpolation search in findLPCNLSF, mirroring libopus's complexity-tier setting (silk_setup_complexity: enabled for encoder complexity >= 4).
Source Files
¶
- a2nlsf.go
- codebook.go
- control_snr.go
- decoder.go
- enc_frame.go
- encoder.go
- errors.go
- find_pitch_lags.go
- find_pred_coefs.go
- gains.go
- icdf.go
- lin2log.go
- lpc_analysis.go
- lpc_float.go
- ltp_analysis.go
- ltp_quant.go
- ltp_scale.go
- math_fix.go
- nlsf_encode.go
- noise_shape.go
- noise_shape_analysis.go
- nsq.go
- pitch_analysis.go
- pitch_ltp.go
- pitch_tables.go
- pitch_util.go
- plc.go
- pulses.go
- silk.go
- vad.go