Versions in this module Expand all Collapse all v0 v0.1.1 Nov 5, 2026 Changes in this version + const DefaultBitrate + const EncoderDelay + const FrameSize + const TotalDelay + var ErrCorruptStream = errors.New("go-mp3: corrupt stream") + var ErrEncoderFinalized = errors.New("go-mp3: encoder finalized; Reset to start a new stream") + var ErrEncoderNotInitialized = errors.New("go-mp3: encoder not initialized") + var ErrInvalidAudio = errors.New("go-mp3: invalid audio sample (NaN or Inf)") + var ErrUnsupported = errors.New("go-mp3: unsupported stream") + type Decoder struct + func NewDecoder() *Decoder + func (d *Decoder) DecodeFrame(data []byte, pcm []float32) (n int, info FrameInfo, err error) + func (d *Decoder) Reset() + type Encoder struct + func NewEncoder(cfg EncoderConfig) (*Encoder, error) + func (e *Encoder) Delay() int + func (e *Encoder) Drained() bool + func (e *Encoder) EncodeFrame(dst []byte, samples [][]float32) ([]byte, error) + func (e *Encoder) Reset(cfg EncoderConfig) error + func (e *Encoder) Stats() Stats + func (e *Encoder) TotalDelay() int + type EncoderConfig struct + Bitrate int + Channels int + RateControl RateControl + SampleRate int + type FrameInfo struct + Bitrate int + Channels int + FrameBytes int + FrameOffset int + Layer int + SampleRate int + type RateControl int + const RateControlExact + const RateControlFast + func (rc RateControl) String() string + type Stats struct + Bytes int64 + Frames int64 + MeanGlobalGain float64 + PaddedFrames int64