docs/doc/reference/com/google/android/exoplayer2/audio/Ac3Util.html
Package com.google.android.exoplayer2.audio
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classAc3Utilextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
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 parsing Dolby TrueHD and (E-)AC-3 syncframes. (E-)AC-3 parsing follows the definition in ETSI TS 102 366 V1.4.1.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | Ac3Util.SyncFrameInfo |
Deprecated.
Holds sample format information as presented by a syncframe header. |
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static int | AC3_MAX_RATE_BYTES_PER_SECOND |
Deprecated.
Maximum rate for an AC-3 audio stream, in bytes per second.
|
| static int | E_AC3_MAX_RATE_BYTES_PER_SECOND |
Deprecated.
Maximum rate for an E-AC-3 audio stream, in bytes per second.
|
| static int | TRUEHD_MAX_RATE_BYTES_PER_SECOND |
Deprecated.
Maximum rate for a TrueHD audio stream, in bytes per second.
|
| static int | TRUEHD_RECHUNK_SAMPLE_COUNT |
Deprecated.
The number of samples to store in each output chunk when rechunking TrueHD streams.
|
| static int | TRUEHD_SYNCFRAME_PREFIX_LENGTH |
Deprecated.
The number of bytes that must be parsed from a TrueHD syncframe to calculate the sample count. |
All Methods Static Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| static int | findTrueHdSyncframeOffset(ByteBuffer buffer) |
Deprecated.
Returns the offset relative to the buffer's position of the start of a TrueHD syncframe, or C.INDEX_UNSET if no syncframe was found.
|
| static Format | parseAc3AnnexFFormat(ParsableByteArray data, String trackId, String language, DrmInitData drmInitData) |
Deprecated.
Returns the AC-3 format given data containing the AC3SpecificBox according to Annex F.
|
| static int | parseAc3SyncframeAudioSampleCount(ByteBuffer buffer) |
Deprecated.
Reads the number of audio samples represented by the given (E-)AC-3 syncframe.
|
| static Ac3Util.SyncFrameInfo | parseAc3SyncframeInfo(ParsableBitArray data) |
Deprecated.
Returns (E-)AC-3 format information given data containing a syncframe.
|
| static int | parseAc3SyncframeSize(byte[] data) |
Deprecated.
Returns the size in bytes of the given (E-)AC-3 syncframe.
|
| static Format | parseEAc3AnnexFFormat(ParsableByteArray data, String trackId, String language, DrmInitData drmInitData) |
Deprecated.
Returns the E-AC-3 format given data containing the EC3SpecificBox according to Annex F.
|
| static int | parseTrueHdSyncframeAudioSampleCount(byte[] syncframe) |
Deprecated.
Returns the number of audio samples represented by the given TrueHD syncframe, or 0 if the buffer is not the start of a syncframe.
|
| static int | parseTrueHdSyncframeAudioSampleCount(ByteBuffer buffer, int offset) |
Deprecated.
Reads the number of audio samples represented by a TrueHD syncframe. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public static final int AC3_MAX_RATE_BYTES_PER_SECOND
Deprecated.
Maximum rate for an AC-3 audio stream, in bytes per second. See Also:Constant Field Values
-
public static final int E_AC3_MAX_RATE_BYTES_PER_SECOND
Deprecated.
Maximum rate for an E-AC-3 audio stream, in bytes per second. See Also:Constant Field Values
-
public static final int TRUEHD_MAX_RATE_BYTES_PER_SECOND
Deprecated.
Maximum rate for a TrueHD audio stream, in bytes per second. See Also:Constant Field Values
-
public static final int TRUEHD_RECHUNK_SAMPLE_COUNT
Deprecated.
The number of samples to store in each output chunk when rechunking TrueHD streams. The number of samples extracted from the container corresponding to one syncframe must be an integer multiple of this value. See Also:Constant Field Values
-
public static final int TRUEHD_SYNCFRAME_PREFIX_LENGTH
Deprecated.
The number of bytes that must be parsed from a TrueHD syncframe to calculate the sample count. See Also:Constant Field Values
-
public static[Format](../Format.html "class in com.google.android.exoplayer2")parseAc3AnnexFFormat([ParsableByteArray](../util/ParsableByteArray.html "class in com.google.android.exoplayer2.util")data,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")trackId,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")language,
@Nullable[DrmInitData](../drm/DrmInitData.html "class in com.google.android.exoplayer2.drm")drmInitData)
Deprecated.
Returns the AC-3 format given data containing the AC3SpecificBox according to Annex F. The reading position of data will be modified.
Parameters:data - The AC3SpecificBox to parse.trackId - The track identifier to set on the format.language - The language to set on the format.drmInitData - DrmInitData to be included in the format.Returns:The AC-3 format parsed from data in the header.
-
public static[Format](../Format.html "class in com.google.android.exoplayer2")parseEAc3AnnexFFormat([ParsableByteArray](../util/ParsableByteArray.html "class in com.google.android.exoplayer2.util")data,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")trackId,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")language,
@Nullable[DrmInitData](../drm/DrmInitData.html "class in com.google.android.exoplayer2.drm")drmInitData)
Deprecated.
Returns the E-AC-3 format given data containing the EC3SpecificBox according to Annex F. The reading position of data will be modified.
Parameters:data - The EC3SpecificBox to parse.trackId - The track identifier to set on the format.language - The language to set on the format.drmInitData - DrmInitData to be included in the format.Returns:The E-AC-3 format parsed from data in the header.
-
public static[Ac3Util.SyncFrameInfo](Ac3Util.SyncFrameInfo.html "class in com.google.android.exoplayer2.audio")parseAc3SyncframeInfo([ParsableBitArray](../util/ParsableBitArray.html "class in com.google.android.exoplayer2.util")data)
Deprecated.
Returns (E-)AC-3 format information given data containing a syncframe. The reading position of data will be modified.
Parameters:data - The data to parse, positioned at the start of the syncframe.Returns:The (E-)AC-3 format data parsed from the header.
-
public static int parseAc3SyncframeSize(byte[] data)
Deprecated.
Returns the size in bytes of the given (E-)AC-3 syncframe.
Parameters:data - The syncframe to parse.Returns:The syncframe size in bytes. C.LENGTH_UNSET if the input is invalid.
-
public static int parseAc3SyncframeAudioSampleCount([ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")buffer)
Deprecated.
Reads the number of audio samples represented by the given (E-)AC-3 syncframe. The buffer's position is not modified.
Parameters:buffer - The ByteBuffer from which to read the syncframe.Returns:The number of audio samples represented by the syncframe.
-
public static int findTrueHdSyncframeOffset([ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")buffer)
Deprecated.
Returns the offset relative to the buffer's position of the start of a TrueHD syncframe, or C.INDEX_UNSET if no syncframe was found. The buffer's position is not modified.
Parameters:buffer - The ByteBuffer within which to find a syncframe.Returns:The offset relative to the buffer's position of the start of a TrueHD syncframe, or C.INDEX_UNSET if no syncframe was found.
-
public static int parseTrueHdSyncframeAudioSampleCount(byte[] syncframe)
Deprecated.
Returns the number of audio samples represented by the given TrueHD syncframe, or 0 if the buffer is not the start of a syncframe.
Parameters:syncframe - The bytes from which to read the syncframe. Must be at least TRUEHD_SYNCFRAME_PREFIX_LENGTH bytes long.Returns:The number of audio samples represented by the syncframe, or 0 if the buffer doesn't contain the start of a syncframe.
-
public static int parseTrueHdSyncframeAudioSampleCount([ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")buffer,
int offset)
Deprecated.
Reads the number of audio samples represented by a TrueHD syncframe. The buffer's position is not modified.
Parameters:buffer - The ByteBuffer from which to read the syncframe.offset - The offset of the start of the syncframe relative to the buffer's position.Returns:The number of audio samples represented by the syncframe.