MpegAudioPackage

Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.CustomPackage

public final class MpegAudioPackage extends CustomPackage

Represents MPEG audio metadata.

This example demonstrates how to read MPEG audio metadata from an MP3 file.

try (Metadata metadata = new Metadata(Constants.MP3WithID3V2)) { MP3RootPackage root = metadata.getRootPackageGeneric(); System.out.println(root.getMpegAudioPackage().getBitrate()); System.out.println(root.getMpegAudioPackage().getChannelMode()); System.out.println(root.getMpegAudioPackage().getEmphasis()); System.out.println(root.getMpegAudioPackage().getFrequency()); System.out.println(root.getMpegAudioPackage().getHeaderPosition()); System.out.println(root.getMpegAudioPackage().getLayer()); // … }

Constructors

Constructor Description
MpegAudioPackage() Initializes a new instance of the MpegAudioPackage class.

Methods

Method Description
getMpegAudioVersion() Gets the MPEG audio version.
getLayer() Gets the layer description.
isProtected() Gets true if protected.
getHeaderPosition() Gets the header offset.
getBitrate() Gets the bitrate.
getFrequency() Gets the frequency.
getPaddingBit() Gets the padding bit.
getPrivateBit() Gets a value indicating whether [private bit].
getChannelMode() Gets the channel mode.
getCopyright() Gets the copyright bit.
isOriginal() Gets the original bit.
getEmphasis() Gets the emphasis.
getModeExtensionBits() Gets the mode extension bits.

MpegAudioPackage()

public MpegAudioPackage()

Initializes a new instance of the MpegAudioPackage class.

getMpegAudioVersion()

public final MpegAudioVersion getMpegAudioVersion()

Gets the MPEG audio version. Can be MPEG-1, MPEG-2 etc.

Returns: MpegAudioVersion - The MPEG audio version.

getLayer()

public final int getLayer()

Gets the layer description. For an MP3 audio it is ‘3’.

Returns: int - The layer description.

isProtected()

public final boolean isProtected()

Gets true if protected.

Returns: boolean - true if is protected; otherwise, false .

getHeaderPosition()

public final long getHeaderPosition()

Gets the header offset.

Returns: long - The header offset.

getBitrate()

public final int getBitrate()

Gets the bitrate.

Returns: int - The bitrate.

getFrequency()

public final int getFrequency()

Gets the frequency.

Returns: int - The frequency.

getPaddingBit()

public final int getPaddingBit()

Gets the padding bit.

Returns: int - The padding bit.

getPrivateBit()

public final boolean getPrivateBit()

Gets a value indicating whether [private bit].

Returns: boolean - true if [private bit]; otherwise, false .

getChannelMode()

public final MpegChannelMode getChannelMode()

Gets the channel mode.

Returns: MpegChannelMode - The channel mode.

getCopyright()

public final boolean getCopyright()

Gets the copyright bit.

Returns: boolean - true if copyright; otherwise, false .

isOriginal()

public final boolean isOriginal()

Gets the original bit.

Returns: boolean - true if audio is original; otherwise, false .

getEmphasis()

public final MpegEmphasis getEmphasis()

Gets the emphasis.

Returns: MpegEmphasis - The emphasis.

getModeExtensionBits()

public final int getModeExtensionBits()

Gets the mode extension bits.

Returns: int - The mode extension bits.