Documentation ¶
Overview ¶
The aac decoder, to decode the encoded aac frame to PCM samples.
Index ¶
- type AacDecoder
- func (v *AacDecoder) AacNumChannels() int
- func (v *AacDecoder) AacSampleRate() int
- func (v *AacDecoder) AacSamplesPerFrame() int
- func (v *AacDecoder) AudioObjectType() int
- func (v *AacDecoder) Bitrate() int
- func (v *AacDecoder) ChannelConfig() int
- func (v *AacDecoder) Close() error
- func (v *AacDecoder) Decode(frame []byte, dst io.Writer) error
- func (v *AacDecoder) ExtensionAudioObjectType() int
- func (v *AacDecoder) ExtensionSamplingRate() int
- func (v *AacDecoder) FrameSize() int
- func (v *AacDecoder) InitAdts() (err error)
- func (v *AacDecoder) InitRaw(asc []byte) (err error)
- func (v *AacDecoder) NumBadAccessUnits() int
- func (v *AacDecoder) NumBadBytes() int
- func (v *AacDecoder) NumChannels() int
- func (v *AacDecoder) NumLostAccessUnits() int
- func (v *AacDecoder) NumTotalAccessUnits() int
- func (v *AacDecoder) NumTotalBytes() int
- func (v *AacDecoder) Profile() int
- func (v *AacDecoder) SampleBits() int
- func (v *AacDecoder) SampleRate() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AacDecoder ¶
type AacDecoder struct {
// contains filtered or unexported fields
}
func NewAacDecoder ¶
func NewAacDecoder() *AacDecoder
func (*AacDecoder) AacNumChannels ¶
func (v *AacDecoder) AacNumChannels() int
The number of audio channels after AAC core processing (before PS or MPS processing).
CAUTION: This are not the final number of output channels!
@remark Decoder internal members.
func (*AacDecoder) AacSampleRate ¶
func (v *AacDecoder) AacSampleRate() int
sampling rate in Hz without SBR (from configuration info). @remark Decoder internal members.
func (*AacDecoder) AacSamplesPerFrame ¶
func (v *AacDecoder) AacSamplesPerFrame() int
Samples per frame for the AAC core (from ASC).
1024 or 960 for AAC-LC 512 or 480 for AAC-LD and AAC-ELD
@remark Decoder internal members.
func (*AacDecoder) AudioObjectType ¶
func (v *AacDecoder) AudioObjectType() int
Audio Object Type (from ASC): is set to the appropriate value for MPEG-2 bitstreams (e. g. 2 for AAC-LC). @remark Decoder internal members.
func (*AacDecoder) Bitrate ¶
func (v *AacDecoder) Bitrate() int
Instantaneous bit rate. @remark Decoder internal members.
func (*AacDecoder) ChannelConfig ¶
func (v *AacDecoder) ChannelConfig() int
Channel configuration (0: PCE defined, 1: mono, 2: stereo, ... @remark Decoder internal members.
func (*AacDecoder) Close ¶
func (v *AacDecoder) Close() error
De-allocate all resources of an AAC decoder instance.
func (*AacDecoder) Decode ¶
func (v *AacDecoder) Decode(frame []byte, dst io.Writer) error
Decode one audio frame. @param the frame contains encoded aac frame, optional can be nil. @eturn when pcm is nil, should fill more bytes and decode again.
func (*AacDecoder) ExtensionAudioObjectType ¶
func (v *AacDecoder) ExtensionAudioObjectType() int
Extension Audio Object Type (from ASC) @remark Decoder internal members.
func (*AacDecoder) ExtensionSamplingRate ¶
func (v *AacDecoder) ExtensionSamplingRate() int
Extension sampling rate in Hz (from ASC) @remark Decoder internal members.
func (*AacDecoder) FrameSize ¶
func (v *AacDecoder) FrameSize() int
The frame size of the decoded PCM audio signal.
1024 or 960 for AAC-LC 2048 or 1920 for HE-AAC (v2) 512 or 480 for AAC-LD and AAC-ELD
@remark The only really relevant ones for the user.
func (*AacDecoder) InitAdts ¶
func (v *AacDecoder) InitAdts() (err error)
Open the decoder in ADTS mode without ASC, we never know the stream info util got the first frame, because the codec info is insert at begin of each frame. @remark The frame to Decode() is muxed in ADTS format.
func (*AacDecoder) InitRaw ¶
func (v *AacDecoder) InitRaw(asc []byte) (err error)
Open the decoder in RAW mode with ASC. For example, the FLV audio payload is a SequenceHeader(ASC) or RAW AAC data, user can init the decoder with ASC and decode the raw data. @remark user should never get the info util decode one frame.
func (*AacDecoder) NumBadAccessUnits ¶
func (v *AacDecoder) NumBadAccessUnits() int
This is the number of total access units that were considered with errors from numTotalBytes. @remark Statistics.
func (*AacDecoder) NumBadBytes ¶
func (v *AacDecoder) NumBadBytes() int
This is the number of total bytes that were considered with errors from numTotalBytes. @remark Statistics.
func (*AacDecoder) NumChannels ¶
func (v *AacDecoder) NumChannels() int
The number of output audio channels in the decoded and interleaved PCM audio signal. @remark The only really relevant ones for the user.
func (*AacDecoder) NumLostAccessUnits ¶
func (v *AacDecoder) NumLostAccessUnits() int
This integer will reflect the estimated amount of lost access units in case aacDecoder_DecodeFrame() returns AAC_DEC_TRANSPORT_SYNC_ERROR. It will be < 0 if the estimation failed. @remark Statistics.
func (*AacDecoder) NumTotalAccessUnits ¶
func (v *AacDecoder) NumTotalAccessUnits() int
This is the number of total access units that have passed through the decoder. @remark Statistics.
func (*AacDecoder) NumTotalBytes ¶
func (v *AacDecoder) NumTotalBytes() int
This is the number of total bytes that have passed through the decoder. @remark Statistics.
func (*AacDecoder) Profile ¶
func (v *AacDecoder) Profile() int
MPEG-2 profile (from file header) (-1: not applicable (e. g. MPEG-4)). @remark Decoder internal members.
func (*AacDecoder) SampleBits ¶
func (v *AacDecoder) SampleBits() int
The bits of a sample, the fdk aac always use 16bits sample.
func (*AacDecoder) SampleRate ¶
func (v *AacDecoder) SampleRate() int
The samplerate in Hz of the fully decoded PCM audio signal (after SBR processing). @remark The only really relevant ones for the user.