Documentation ¶
Overview ¶
The oryx AAC package includes some utilites.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ADTS ¶
type ADTS interface { // Set the ASC, the codec information. // Before encoding raw frame, user must set the asc. SetASC(asc []byte) (err error) // Encode the raw aac frame to adts data. // @remark User must set the asc first. Encode(raw []byte) (adts []byte, err error) // Decode the adts data to raw frame. // @remark User can get the asc after decode ok. // @remark When left if not nil, user must decode it again. Decode(adts []byte) (raw, left []byte, err error) // Get the ASC, the codec information. // When decode a adts data or set the asc, user can use this API to get it. ASC() *AudioSpecificConfig }
The ADTS is a format of AAC. We can encode the RAW AAC frame in ADTS muxer. We can also decode the ADTS data to RAW AAC frame.
type AudioSpecificConfig ¶
type AudioSpecificConfig struct { Object ObjectType // AAC object type. SampleRate SampleRateIndex // AAC sample rate, not the FLV sampling rate. Channels Channels // AAC channel configuration. }
Convert the ASC(Audio Specific Configuration). Refer to @doc ISO_IEC_14496-3-AAC-2001.pdf, @page 33, @section 1.6.2.1 AudioSpecificConfig
func (*AudioSpecificConfig) MarshalBinary ¶
func (v *AudioSpecificConfig) MarshalBinary() (data []byte, err error)
func (*AudioSpecificConfig) UnmarshalBinary ¶
func (v *AudioSpecificConfig) UnmarshalBinary(data []byte) (err error)
type Channels ¶
type Channels uint8
The aac channel. Refer to @doc ISO_IEC_13818-7-AAC-2004.pdf, @page 72, @section Table 42 – Implicit speaker mapping
const ( ChannelForbidden Channels = iota // center front speaker // FFMPEG: mono FC ChannelMono // left, right front speakers // FFMPEG: stereo FL+FR ChannelStereo // center front speaker, left, right front speakers // FFMPEG: 2.1 FL+FR+LFE // FFMPEG: 3.0 FL+FR+FC // FFMPEG: 3.0(back) FL+FR+BC Channel3 // center front speaker, left, right center front speakers, rear surround // FFMPEG: 4.0 FL+FR+FC+BC // FFMPEG: quad FL+FR+BL+BR // FFMPEG: quad(side) FL+FR+SL+SR // FFMPEG: 3.1 FL+FR+FC+LFE Channel4 // center front speaker, left, right front speakers, left surround, right surround rear speakers // FFMPEG: 5.0 FL+FR+FC+BL+BR // FFMPEG: 5.0(side) FL+FR+FC+SL+SR // FFMPEG: 4.1 FL+FR+FC+LFE+BC Channel5 // center front speaker, left, right front speakers, left surround, right surround rear speakers, // front low frequency effects speaker // FFMPEG: 5.1 FL+FR+FC+LFE+BL+BR // FFMPEG: 5.1(side) FL+FR+FC+LFE+SL+SR // FFMPEG: 6.0 FL+FR+FC+BC+SL+SR // FFMPEG: 6.0(front) FL+FR+FLC+FRC+SL+SR // FFMPEG: hexagonal FL+FR+FC+BL+BR+BC Channel5_1 // speakers: 6 // center front speaker, left, right center front speakers, left, right outside front speakers, // left surround, right surround rear speakers, front low frequency effects speaker // FFMPEG: 7.1 FL+FR+FC+LFE+BL+BR+SL+SR // FFMPEG: 7.1(wide) FL+FR+FC+LFE+BL+BR+FLC+FRC // FFMPEG: 7.1(wide-side) FL+FR+FC+LFE+FLC+FRC+SL+SR Channel7_1 // speakers: 7 )
type ObjectType ¶
type ObjectType uint8
The AAC object type in RAW AAC frame. Refer to @doc ISO_IEC_14496-3-AAC-2001.pdf, @page 23, @section 1.5.1.1 Audio object type definition
const ( ObjectTypeForbidden ObjectType = iota ObjectTypeMain ObjectTypeLC ObjectTypeSSR ObjectTypeHE ObjectType = 5 // HE=LC+SBR ObjectTypeHEv2 ObjectType = 29 // HEv2=LC+SBR+PS )
func (ObjectType) String ¶
func (v ObjectType) String() string
func (ObjectType) ToProfile ¶
func (v ObjectType) ToProfile() Profile
type Profile ¶
type Profile uint8
The profile of AAC in ADTS. Refer to @doc ISO_IEC_13818-7-AAC-2004.pdf, @page 40, @section 7.1 Profiles
func (Profile) ToObjectType ¶
func (v Profile) ToObjectType() ObjectType
type SampleRateIndex ¶
type SampleRateIndex uint8
The aac sample rate index. Refer to @doc ISO_IEC_13818-7-AAC-2004.pdf, @page 46, @section Table 35 – Sampling frequency
const ( SampleRateIndex96kHz SampleRateIndex = iota SampleRateIndex88kHz SampleRateIndex64kHz SampleRateIndex48kHz SampleRateIndex44kHz SampleRateIndex32kHz SampleRateIndex24kHz SampleRateIndex22kHz SampleRateIndex16kHz SampleRateIndex12kHz SampleRateIndex11kHz SampleRateIndex8kHz SampleRateIndex7kHz SampleRateIndexReserved0 SampleRateIndexReserved1 SampleRateIndexReserved2 SampleRateIndexReserved3 SampleRateIndexForbidden )
func (SampleRateIndex) String ¶
func (v SampleRateIndex) String() string
func (SampleRateIndex) ToHz ¶
func (v SampleRateIndex) ToHz() int