Class AacUtil
- java.lang.Object
 - 
- com.google.android.exoplayer2.audio.AacUtil
 
 
- 
@Deprecated public final class AacUtil extends Object
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Utility methods for handling AAC audio streams. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAacUtil.AacAudioObjectTypeDeprecated.Valid AAC Audio object types.static classAacUtil.ConfigDeprecated.Holds sample format information for AAC audio. 
- 
Field Summary
Fields Modifier and Type Field Description static intAAC_ELD_MAX_RATE_BYTES_PER_SECONDDeprecated.Maximum rate for an AAC ELD audio stream, in bytes per second.static intAAC_HE_AUDIO_SAMPLE_COUNTDeprecated.Number of raw audio samples that are produced per channel when decoding an AAC HE access unit.static intAAC_HE_V1_MAX_RATE_BYTES_PER_SECONDDeprecated.Maximum rate for an AAC HE V1 audio stream, in bytes per second.static intAAC_HE_V2_MAX_RATE_BYTES_PER_SECONDDeprecated.Maximum rate for an AAC HE V2 audio stream, in bytes per second.static intAAC_LC_AUDIO_SAMPLE_COUNTDeprecated.Number of raw audio samples that are produced per channel when decoding an AAC LC access unit.static intAAC_LC_MAX_RATE_BYTES_PER_SECONDDeprecated.Maximum rate for an AAC LC audio stream, in bytes per second.static intAAC_LD_AUDIO_SAMPLE_COUNTDeprecated.Number of raw audio samples that are produced per channel when decoding an AAC LD access unit.static intAAC_XHE_AUDIO_SAMPLE_COUNTDeprecated.Number of raw audio samples that are produced per channel when decoding an AAC XHE access unit.static intAAC_XHE_MAX_RATE_BYTES_PER_SECONDDeprecated.Maximum rate for an AAC XHE audio stream, in bytes per second.static intAUDIO_OBJECT_TYPE_AAC_ELDDeprecated.static intAUDIO_OBJECT_TYPE_AAC_ER_BSACDeprecated.static intAUDIO_OBJECT_TYPE_AAC_LCDeprecated.static intAUDIO_OBJECT_TYPE_AAC_PSDeprecated.static intAUDIO_OBJECT_TYPE_AAC_SBRDeprecated.static intAUDIO_OBJECT_TYPE_AAC_XHEDeprecated. 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static byte[]buildAacLcAudioSpecificConfig(int sampleRate, int channelCount)Deprecated.Builds a simple AAC LC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1static byte[]buildAudioSpecificConfig(int audioObjectType, int sampleRateIndex, int channelConfig)Deprecated.Builds a simple AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1static AacUtil.ConfigparseAudioSpecificConfig(byte[] audioSpecificConfig)Deprecated.Parses an AAC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1static AacUtil.ConfigparseAudioSpecificConfig(ParsableBitArray bitArray, boolean forceReadToEnd)Deprecated.Parses an AAC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1 
 - 
 
- 
- 
Field Detail
- 
AAC_LC_AUDIO_SAMPLE_COUNT
public static final int AAC_LC_AUDIO_SAMPLE_COUNT
Deprecated.Number of raw audio samples that are produced per channel when decoding an AAC LC access unit.- See Also:
 - Constant Field Values
 
 
- 
AAC_XHE_AUDIO_SAMPLE_COUNT
public static final int AAC_XHE_AUDIO_SAMPLE_COUNT
Deprecated.Number of raw audio samples that are produced per channel when decoding an AAC XHE access unit.- See Also:
 - Constant Field Values
 
 
- 
AAC_HE_AUDIO_SAMPLE_COUNT
public static final int AAC_HE_AUDIO_SAMPLE_COUNT
Deprecated.Number of raw audio samples that are produced per channel when decoding an AAC HE access unit.- See Also:
 - Constant Field Values
 
 
- 
AAC_LD_AUDIO_SAMPLE_COUNT
public static final int AAC_LD_AUDIO_SAMPLE_COUNT
Deprecated.Number of raw audio samples that are produced per channel when decoding an AAC LD access unit.- See Also:
 - Constant Field Values
 
 
- 
AAC_LC_MAX_RATE_BYTES_PER_SECOND
public static final int AAC_LC_MAX_RATE_BYTES_PER_SECOND
Deprecated.Maximum rate for an AAC LC audio stream, in bytes per second.- See Also:
 - Constant Field Values
 
 
- 
AAC_HE_V1_MAX_RATE_BYTES_PER_SECOND
public static final int AAC_HE_V1_MAX_RATE_BYTES_PER_SECOND
Deprecated.Maximum rate for an AAC HE V1 audio stream, in bytes per second.- See Also:
 - Constant Field Values
 
 
- 
AAC_HE_V2_MAX_RATE_BYTES_PER_SECOND
public static final int AAC_HE_V2_MAX_RATE_BYTES_PER_SECOND
Deprecated.Maximum rate for an AAC HE V2 audio stream, in bytes per second.- See Also:
 - Constant Field Values
 
 
- 
AAC_XHE_MAX_RATE_BYTES_PER_SECOND
public static final int AAC_XHE_MAX_RATE_BYTES_PER_SECOND
Deprecated.Maximum rate for an AAC XHE audio stream, in 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.
- See Also:
 - Constant Field Values
 
 
- 
AAC_ELD_MAX_RATE_BYTES_PER_SECOND
public static final int AAC_ELD_MAX_RATE_BYTES_PER_SECOND
Deprecated.Maximum rate for an AAC ELD audio stream, in bytes per second.Fraunhofer documentation shows AAC-ELD as useful for up to ~ 64 kbit/s so we use this value.
- See Also:
 - Constant Field Values
 
 
- 
AUDIO_OBJECT_TYPE_AAC_LC
public static final int AUDIO_OBJECT_TYPE_AAC_LC
Deprecated.- See Also:
 - Constant Field Values
 
 
- 
AUDIO_OBJECT_TYPE_AAC_SBR
public static final int AUDIO_OBJECT_TYPE_AAC_SBR
Deprecated.- See Also:
 - Constant Field Values
 
 
- 
AUDIO_OBJECT_TYPE_AAC_ER_BSAC
public static final int AUDIO_OBJECT_TYPE_AAC_ER_BSAC
Deprecated.- See Also:
 - Constant Field Values
 
 
- 
AUDIO_OBJECT_TYPE_AAC_ELD
public static final int AUDIO_OBJECT_TYPE_AAC_ELD
Deprecated.- See Also:
 - Constant Field Values
 
 
- 
AUDIO_OBJECT_TYPE_AAC_PS
public static final int AUDIO_OBJECT_TYPE_AAC_PS
Deprecated.- See Also:
 - Constant Field Values
 
 
- 
AUDIO_OBJECT_TYPE_AAC_XHE
public static final int AUDIO_OBJECT_TYPE_AAC_XHE
Deprecated.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
parseAudioSpecificConfig
public static AacUtil.Config parseAudioSpecificConfig(byte[] audioSpecificConfig) throws ParserException
Deprecated.Parses an AAC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1- Parameters:
 audioSpecificConfig- A byte array containing the AudioSpecificConfig to parse.- Returns:
 - The parsed configuration.
 - Throws:
 ParserException- If the AudioSpecificConfig cannot be parsed because it is invalid or unsupported.
 
- 
parseAudioSpecificConfig
public static AacUtil.Config parseAudioSpecificConfig(ParsableBitArray bitArray, boolean forceReadToEnd) throws ParserException
Deprecated.Parses an AAC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1- Parameters:
 bitArray- AParsableBitArraycontaining 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.- Returns:
 - The parsed configuration.
 - Throws:
 ParserException- If the AudioSpecificConfig cannot be parsed because it is invalid or unsupported.
 
- 
buildAacLcAudioSpecificConfig
public static byte[] buildAacLcAudioSpecificConfig(int sampleRate, int channelCount)Deprecated.Builds a simple AAC LC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1- Parameters:
 sampleRate- The sample rate in Hz.channelCount- The channel count.- Returns:
 - The AudioSpecificConfig.
 
 
- 
buildAudioSpecificConfig
public static byte[] buildAudioSpecificConfig(int audioObjectType, int sampleRateIndex, int channelConfig)Deprecated.Builds a simple AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1- Parameters:
 audioObjectType- The audio object type.sampleRateIndex- The sample rate index.channelConfig- The channel configuration.- Returns:
 - The AudioSpecificConfig.
 
 
 - 
 
 -