aac

package
v0.0.0-...-aa897e2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 8 Imported by: 0

README

AAC-LD and AAC-ELD

Codec Rate QuickTime ffmpeg VLC
AAC-LD 8000 yes no no
AAC-LD 16000 yes no no
AAC-LD 22050 yes yes no
AAC-LD 24000 yes yes no
AAC-LD 32000 yes yes no
AAC-ELD 8000 yes no no
AAC-ELD 16000 yes no no
AAC-ELD 22050 yes yes yes
AAC-ELD 24000 yes yes yes
AAC-ELD 32000 yes yes yes

Documentation

Index

Constants

View Source
const (
	TypeAACMain = 1
	TypeAACLC   = 2  // Low Complexity
	TypeAACLD   = 23 // Low Delay (48000, 44100, 32000, 24000, 22050)
	TypeESCAPE  = 31
	TypeAACELD  = 39 // Enhanced Low Delay

	AUTime = 1024

	// FMTP streamtype=5 - audio stream
	FMTP = "streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config="
)
View Source
const ADTSHeaderSize = 7
View Source
const RTPPacketVersionAAC = 0

Variables

This section is empty.

Functions

func ADTSTimeSize

func ADTSTimeSize(b []byte) uint32

func ADTSToCodec

func ADTSToCodec(b []byte) *core.Codec

func ADTStoRTP

func ADTStoRTP(src []byte) (dst []byte)

func CodecToADTS

func CodecToADTS(codec *core.Codec) []byte

func ConfigToCodec

func ConfigToCodec(conf []byte) *core.Codec

func DecodeConfig

func DecodeConfig(b []byte) (objType, sampleFreqIdx, channels byte, sampleRate uint32)

func EncodeConfig

func EncodeConfig(objType byte, sampleRate uint32, channels byte, shortFrame bool) []byte

func EncodeToADTS

func EncodeToADTS(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc

func IsADTS

func IsADTS(b []byte) bool

func RTPDepay

func RTPDepay(handler core.HandlerFunc) core.HandlerFunc

func RTPPay

func RTPPay(handler core.HandlerFunc) core.HandlerFunc

func RTPTimeSize

func RTPTimeSize(b []byte) uint32

func RTPToADTS

func RTPToADTS(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc

func RTPToCodec

func RTPToCodec(b []byte) *core.Codec

func ReadADTSSize

func ReadADTSSize(b []byte) uint16

func WriteADTSSize

func WriteADTSSize(b []byte, size uint16)

Types

type Consumer

type Consumer struct {
	core.Connection
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer() *Consumer

func (*Consumer) AddTrack

func (c *Consumer) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) error

func (*Consumer) WriteTo

func (c *Consumer) WriteTo(wr io.Writer) (int64, error)

type Producer

type Producer struct {
	core.Connection
	// contains filtered or unexported fields
}

func Open

func Open(r io.Reader) (*Producer, error)

func (*Producer) Start

func (c *Producer) Start() error

Jump to

Keyboard shortcuts

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