mpeg4audio

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 2 Imported by: 5

Documentation

Overview

Package mpeg4audio contains utilities to work with MPEG-4 audio codecs.

Index

Constants

View Source
const (
	// MaxAccessUnitSize is the maximum size of an Access Unit (AU).
	MaxAccessUnitSize = 5 * 1024

	// SamplesPerAccessUnit is the number of samples contained by a single AAC AU.
	SamplesPerAccessUnit = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ADTSPacket

type ADTSPacket struct {
	Type         ObjectType
	SampleRate   int
	ChannelCount int
	AU           []byte
}

ADTSPacket is an ADTS packet.

type ADTSPackets

type ADTSPackets []*ADTSPacket

ADTSPackets is a group od ADTS packets.

func (ADTSPackets) Marshal

func (ps ADTSPackets) Marshal() ([]byte, error)

Marshal encodes ADTS packets into an ADTS stream.

func (*ADTSPackets) Unmarshal

func (ps *ADTSPackets) Unmarshal(buf []byte) error

Unmarshal decodes an ADTS stream into ADTS packets.

type Config

type Config struct {
	Type         ObjectType
	SampleRate   int
	ChannelCount int

	// SBR / PS specific
	ExtensionType       ObjectType
	ExtensionSampleRate int

	// AAC-LC specific
	FrameLengthFlag    bool
	DependsOnCoreCoder bool
	CoreCoderDelay     uint16
}

Config is a MPEG-4 Audio configuration.

func (Config) Marshal

func (c Config) Marshal() ([]byte, error)

Marshal encodes a Config.

func (*Config) Unmarshal

func (c *Config) Unmarshal(buf []byte) error

Unmarshal decodes a Config.

type ObjectType

type ObjectType int

ObjectType is a MPEG-4 Audio object type.

const (
	ObjectTypeAACLC ObjectType = 2
	ObjectTypeSBR   ObjectType = 5
	ObjectTypePS    ObjectType = 29
)

supported types.

Jump to

Keyboard shortcuts

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