Class MpegAudioUtil.Header

  • Enclosing class:
    MpegAudioUtil

    public static final class MpegAudioUtil.Header
    extends Object
    Stores the metadata for an MPEG audio frame.
    • 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.