public final class AacUtil extends Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
AacUtil.AacAudioObjectType |
Valid AAC Audio object types.
|
static class |
AacUtil.Config |
Holds sample format information for AAC audio.
|
Modifier and Type | Field | Description |
---|---|---|
static int |
AAC_ELD_MAX_RATE_BYTES_PER_SECOND |
Maximum rate for an AAC ELD audio stream, in bytes per second.
|
static int |
AAC_HE_AUDIO_SAMPLE_COUNT |
Number of raw audio samples that are produced per channel when decoding an AAC HE access unit.
|
static int |
AAC_HE_V1_MAX_RATE_BYTES_PER_SECOND |
Maximum rate for an AAC HE V1 audio stream, in bytes per second.
|
static int |
AAC_HE_V2_MAX_RATE_BYTES_PER_SECOND |
Maximum rate for an AAC HE V2 audio stream, in bytes per second.
|
static int |
AAC_LC_AUDIO_SAMPLE_COUNT |
Number of raw audio samples that are produced per channel when decoding an AAC LC access unit.
|
static int |
AAC_LC_MAX_RATE_BYTES_PER_SECOND |
Maximum rate for an AAC LC audio stream, in bytes per second.
|
static int |
AAC_LD_AUDIO_SAMPLE_COUNT |
Number of raw audio samples that are produced per channel when decoding an AAC LD access unit.
|
static int |
AAC_XHE_AUDIO_SAMPLE_COUNT |
Number of raw audio samples that are produced per channel when decoding an AAC XHE access unit.
|
static int |
AAC_XHE_MAX_RATE_BYTES_PER_SECOND |
Maximum rate for an AAC XHE audio stream, in bytes per second.
|
static int |
AUDIO_OBJECT_TYPE_AAC_ELD |
|
static int |
AUDIO_OBJECT_TYPE_AAC_ER_BSAC |
|
static int |
AUDIO_OBJECT_TYPE_AAC_LC |
|
static int |
AUDIO_OBJECT_TYPE_AAC_PS |
|
static int |
AUDIO_OBJECT_TYPE_AAC_SBR |
|
static int |
AUDIO_OBJECT_TYPE_AAC_XHE |
Modifier and Type | Method | Description |
---|---|---|
static byte[] |
buildAacLcAudioSpecificConfig(int sampleRate,
int channelCount) |
Builds a simple AAC LC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
|
static byte[] |
buildAudioSpecificConfig(int audioObjectType,
int sampleRateIndex,
int channelConfig) |
Builds a simple AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
|
static int |
getEncodingForAudioObjectType(int audioObjectType) |
Returns the encoding for a given AAC audio object type.
|
static AacUtil.Config |
parseAudioSpecificConfig(byte[] audioSpecificConfig) |
Parses an AAC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
|
static AacUtil.Config |
parseAudioSpecificConfig(ParsableBitArray bitArray,
boolean forceReadToEnd) |
Parses an AAC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
|
public static final int AAC_LC_AUDIO_SAMPLE_COUNT
public static final int AAC_XHE_AUDIO_SAMPLE_COUNT
public static final int AAC_HE_AUDIO_SAMPLE_COUNT
public static final int AAC_LD_AUDIO_SAMPLE_COUNT
public static final int AAC_LC_MAX_RATE_BYTES_PER_SECOND
public static final int AAC_HE_V1_MAX_RATE_BYTES_PER_SECOND
public static final int AAC_HE_V2_MAX_RATE_BYTES_PER_SECOND
public static final int AAC_XHE_MAX_RATE_BYTES_PER_SECOND
Fraunhofer documentation says "500 kbit/s and above" for stereo, so we use a rate generously above the 500 kbit/s level.
public static final int AAC_ELD_MAX_RATE_BYTES_PER_SECOND
Fraunhofer documentation shows AAC-ELD as useful for up to ~ 64 kbit/s so we use this value.
public static final int AUDIO_OBJECT_TYPE_AAC_LC
public static final int AUDIO_OBJECT_TYPE_AAC_SBR
public static final int AUDIO_OBJECT_TYPE_AAC_ER_BSAC
public static final int AUDIO_OBJECT_TYPE_AAC_ELD
public static final int AUDIO_OBJECT_TYPE_AAC_PS
public static final int AUDIO_OBJECT_TYPE_AAC_XHE
public static AacUtil.Config parseAudioSpecificConfig(byte[] audioSpecificConfig) throws ParserException
audioSpecificConfig
- A byte array containing the AudioSpecificConfig to parse.ParserException
- If the AudioSpecificConfig cannot be parsed because it is invalid or
unsupported.public static AacUtil.Config parseAudioSpecificConfig(ParsableBitArray bitArray, boolean forceReadToEnd) throws ParserException
bitArray
- A ParsableBitArray
containing the AudioSpecificConfig to parse. The
position is advanced to the end of the AudioSpecificConfig.forceReadToEnd
- Whether the entire AudioSpecificConfig should be read. Required for
knowing the length of the configuration payload.ParserException
- If the AudioSpecificConfig cannot be parsed because it is invalid or
unsupported.public static byte[] buildAacLcAudioSpecificConfig(int sampleRate, int channelCount)
sampleRate
- The sample rate in Hz.channelCount
- The channel count.public static byte[] buildAudioSpecificConfig(int audioObjectType, int sampleRateIndex, int channelConfig)
audioObjectType
- The audio object type.sampleRateIndex
- The sample rate index.channelConfig
- The channel configuration.@Encoding public static int getEncodingForAudioObjectType(@AacAudioObjectType int audioObjectType)