MpegAudioUtil.Header


class MpegAudioUtil.Header


Stores the metadata for an MPEG audio frame.

Summary

Public constructors

Public functions

Boolean
setForHeaderData(headerData: Int)

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

Public properties

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.

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

Header

Header()

Public functions

setForHeaderData

fun setForHeaderData(headerData: Int): Boolean

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: Int

Header data to parse.

Returns
Boolean

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

Public properties

bitrate

val bitrateInt

Bitrate of the frame in bit/s.

channels

val channelsInt

Number of audio channels in the frame.

frameSize

val frameSizeInt

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

mimeType

val mimeTypeString?

The MIME type.

sampleRate

val sampleRateInt

Sample rate in samples per second.

samplesPerFrame

val samplesPerFrameInt

Number of samples stored in the frame.

version

val versionInt

MPEG audio header version.