public final class

MpegAudioUtil.Header

extends java.lang.Object

 java.lang.Object

↳androidx.media3.extractor.MpegAudioUtil.Header

Overview

Stores the metadata for an MPEG audio frame.

Summary

Fields
public intbitrate

Bitrate of the frame in bit/s.

public intchannels

Number of audio channels in the frame.

public intframeSize

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

public java.lang.StringmimeType

The MIME type.

public intsampleRate

Sample rate in samples per second.

public intsamplesPerFrame

Number of samples stored in the frame.

public intversion

MPEG audio header version.

Constructors
publicHeader()

Constructs an empty instance.

publicHeader(MpegAudioUtil.Header header)

Constructs an instance with values from header.

Methods
public booleansetForHeaderData(int headerData)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public int version

MPEG audio header version.

public java.lang.String mimeType

The MIME type.

public int frameSize

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

public int sampleRate

Sample rate in samples per second.

public int channels

Number of audio channels in the frame.

public int bitrate

Bitrate of the frame in bit/s.

public int samplesPerFrame

Number of samples stored in the frame.

Constructors

public Header()

Constructs an empty instance.

public Header(MpegAudioUtil.Header header)

Constructs an instance with values from header.

Methods

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.