Package com.google.android.exoplayer2.audio

## Class MpegAudioUtil.Header

- java.lang.Object
- - com.google.android.exoplayer2.audio.MpegAudioUtil.Header

- Enclosing class:
    MpegAudioUtil

      public static final class MpegAudioUtil.Header
      extends Object

  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 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.