aac

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package aac encodes AAC-LC (ISO/IEC 14496-3): PCM in, ADTS frames out, mono to 5.1 at 44.1 or 48 kHz. Long blocks, a sine window, mid/side stereo, a rate loop with a bit reservoir over band thresholds that follow the signal's energy.

Index

Constants

View Source
const Delay = 1024

Delay is how many samples the decoded audio lags the input.

View Source
const FrameSamples = 1024

FrameSamples is a frame's samples per channel.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder codes PCM as AAC-LC.

func NewEncoder

func NewEncoder(channels int, lfe bool, rate, kbps int) (*Encoder, error)

NewEncoder makes an encoder for channels at rate (44100 or 48000) and kbps kb/s. Channels go in AAC's order: C (mono), L R (stereo), C L R, C L R S, C L R Ls Rs, C L R Ls Rs LFE (lfe set, 6 channels).

func (*Encoder) Config

func (e *Encoder) Config() []byte

Config is the stream's AudioSpecificConfig.

func (*Encoder) EncodeFrame

func (e *Encoder) EncodeFrame(pcm [][]float64) ([]byte, error)

EncodeFrame codes FrameSamples samples per channel (in [-1, 1]) as one ADTS frame.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL