MpegAudioUtil.Header


public final class MpegAudioUtil.Header


Stores the metadata for an MPEG audio frame.

Summary

Public fields

int

Bitrate of the frame in bit/s.

int

Number of audio channels in the frame.

int

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

@Nullable String

The MIME type.

int

Sample rate in samples per second.

int

Number of samples stored in the frame.

int

MPEG audio header version.

Public constructors

Constructs an empty instance.

Constructs an instance with values from header.

Public methods

boolean
setForHeaderData(int headerData)

Populates the fields in this instance to reflect the MPEG audio header in headerData, returning whether the header was valid.

Public fields

bitrate

public int bitrate

Bitrate of the frame in bit/s.

channels

public int channels

Number of audio channels in the frame.

frameSize

public int frameSize

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

mimeType

public @Nullable String mimeType

The MIME type.

sampleRate

public int sampleRate

Sample rate in samples per second.

samplesPerFrame

public int samplesPerFrame

Number of samples stored in the frame.

version

public int version

MPEG audio header version.

Public constructors

Header

public Header()

Constructs an empty instance.

Header

public Header(MpegAudioUtil.Header header)

Constructs an instance with values from header.

Public methods

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
int headerData

Header data to parse.

Returns
boolean

True if the fields were populated. False otherwise, indicating that headerData is not a valid MPEG audio header.