aac

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAAC = errors.New("lal.aac: fxxk")

Functions

func BuildAACSeqHeader

func BuildAACSeqHeader(asc []byte) ([]byte, error)

@param <asc> 函数调用结束后,内部不继续持有<asc>内存块

@return 返回的内存块为新申请的独立内存块

func ParseAACSeqHeader

func ParseAACSeqHeader(b []byte) (sh SequenceHeader, adts ADTS, err error)

@param <b> rtmp/flv的message/tag的payload部分,包含前面2个字节

函数调用结束后,内部不持有<b>内存块

Types

type ADTS

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

Audio Data Transport Stream

func (*ADTS) CalcADTSHeader

func (a *ADTS) CalcADTSHeader(length uint16) ([]byte, error)

获取ADTS头,由于ADTS头中的字段依赖包的长度,而每个包的长度不同,所以生成的每个包的ADTS头也不同

@param <length> raw aac frame的大小

注意,如果是rtmp/flv的message/tag,应去除Seq Header头部的2个字节

@return 返回的内存块,内部会继续持有,重复使用

func (*ADTS) HasInited

func (a *ADTS) HasInited() bool

可用于判断,是否调用过ADTS.InitWithAACAudioSpecificConfig

func (*ADTS) InitWithAACAudioSpecificConfig

func (a *ADTS) InitWithAACAudioSpecificConfig(asc []byte) error

@param <asc> 2字节的AAC Audio Specifc Config

函数调用结束后,内部不持有<asc>内存块
注意,如果是rtmp/flv的message/tag,应去除Seq Header头部的2个字节

type SequenceHeader

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

Jump to

Keyboard shortcuts

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