heaac

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT, Apache-2.0, MIT Imports: 9 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

Index

Constants

View Source
const (
	SamplesPerFrame = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ASC

type ASC struct {
	ObjectType             int // the core's audio object type (2 for AAC-LC)
	SamplingFrequencyIndex int
	SamplingFrequency      int
	ChannelConfiguration   int
	// SBR is 1 when signalled present, 0 when signalled absent, and -1
	// when the AudioSpecificConfig does not signal it.
	SBR int
	// PS likewise.
	PS int
	// ExtensionSamplingFrequency is the SBR rate when SBR is signalled.
	ExtensionSamplingFrequency int
	FrameLengthFlag            bool
	// contains filtered or unexported fields
}

ASC is the part of an MPEG-4 AudioSpecificConfig (ISO/IEC 14496-3 §1.6.2.1) the decoder uses.

func ParseASC

func ParseASC(asc []byte) (*ASC, error)

ParseASC parses an AudioSpecificConfig.

func (*ASC) AllowsImplicitPS

func (a *ASC) AllowsImplicitPS() bool

AllowsImplicitPS reports whether an in-band PS extension can widen the core.

type Decoder

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

Decoder holds AAC-LC, SBR and parametric stereo state for one raw access-unit stream.

func NewDecoder

func NewDecoder(a *ASC) (*Decoder, error)

NewDecoder configures raw access-unit decoding for AAC-LC and any explicitly signalled SBR and PS extension.

func (*Decoder) ChannelNames

func (d *Decoder) ChannelNames() []string

ChannelNames are the decoded channels' speakers in output order, as ffmpeg names them, for channel configuration 0 (a program_config_element) and 3 to 6 (ISO/IEC 14496-3 Table 1.19), and nil for mono and stereo output. A program of one SCE with parametric stereo is stereo output (#1754: ISO's PS conformance streams signal their mono core with a program_config_element), so nil, not the SCE's one name.

func (*Decoder) DecodeAU

func (d *Decoder) DecodeAU(au []byte) ([]float32, error)

DecodeAU decodes one raw access unit to interleaved samples, a full-scale 16-bit sample being 1.0.

func (*Decoder) DecodeLCAU

func (d *Decoder) DecodeLCAU(au []byte) ([]int16, error)

DecodeLCAU decodes one AAC-LC access unit to interleaved signed 16-bit PCM. It rejects in-band SBR and quantizes directly from the core filterbank's float64 samples, in signed-16 sample units.

func (*Decoder) OutputChannels

func (d *Decoder) OutputChannels() int

OutputChannels is the number of decoded channels, including the second channel produced by parametric stereo when signalled.

func (*Decoder) OutputSampleRate

func (d *Decoder) OutputSampleRate() int

OutputSampleRate is the rate of the decoded samples: the SBR rate when SBR is decoded.

Directories

Path Synopsis
Package adts builds and parses Audio Data Transport Stream headers.
Package adts builds and parses Audio Data Transport Stream headers.
internal
bits
Package bits implements the MSB-first bit I/O used by AAC syntax elements.
Package bits implements the MSB-first bit I/O used by AAC syntax elements.
coder
Package coder implements the quantization and entropy-coding layer shared by the AAC encoder and decoder: scalefactor and spectral Huffman codes (ISO/IEC 14496-3 §4.6.3) and the inverse quantizer (§4.6.2).
Package coder implements the quantization and entropy-coding layer shared by the AAC encoder and decoder: scalefactor and spectral Huffman codes (ISO/IEC 14496-3 §4.6.3) and the inverse quantizer (§4.6.2).
tables
Package tables contains data tables shared by the AAC codec stages.
Package tables contains data tables shared by the AAC codec stages.
transform
Package transform implements the inverse modified discrete cosine transform and synthesis windows used by AAC (ISO/IEC 14496-3 §4.6.11).
Package transform implements the inverse modified discrete cosine transform and synthesis windows used by AAC (ISO/IEC 14496-3 §4.6.11).

Jump to

Keyboard shortcuts

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