Back to Exoplayer

MpegAudioUtil.Header (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/audio/MpegAudioUtil.Header.html

latest3.1 KB
Original Source

Package com.google.android.exoplayer2.audio

Class MpegAudioUtil.Header


public static final classMpegAudioUtil.Headerextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Stores the metadata for an MPEG audio frame.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | int | bitrate | Bitrate of the frame in bit/s. | | int | channels | Number of audio channels in the frame. | | int | frameSize | Size of the frame associated with this header, in bytes. | | String | mimeType | The MIME type. | | int | sampleRate | Sample rate in samples per second. | | int | samplesPerFrame | Number of samples stored in the frame. | | int | version | MPEG audio header version. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | Header() | |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | boolean | setForHeaderData​(int headerData) | Populates the fields in this instance to reflect the MPEG audio header in headerData, returning whether the header was valid. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

version

public int version

MPEG audio header version.

- 

mimeType

@Nullable
public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")mimeType

The MIME type.

- 

frameSize

public int frameSize

Size of the frame associated with this header, in bytes.

- 

sampleRate

public int sampleRate

Sample rate in samples per second.

- 

channels

public int channels

Number of audio channels in the frame.

- 

bitrate

public int bitrate

Bitrate of the frame in bit/s.

- 

samplesPerFrame

public int samplesPerFrame

Number of samples stored in the frame.

Constructor Detail

- 

Header

public Header()

Method Detail

- 

setForHeaderData

public boolean setForHeaderData​(int headerData)

Populates the fields in this instance to reflect the MPEG audio header in headerData, returning whether the header was valid. If false, the values of the fields in this instance will not be updated. Parameters:headerData - Header data to parse.Returns:True if the fields were populated. False otherwise, indicating that headerData is not a valid MPEG audio header.