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()); // ... }
| Constructor and Description |
|---|
MpegAudioPackage()
Initializes a new instance of the
MpegAudioPackage class. |
| Modifier and Type | Method and Description |
|---|---|
int |
getBitrate()
Gets the bitrate.
|
MpegChannelMode |
getChannelMode()
Gets the channel mode.
|
boolean |
getCopyright()
Gets the copyright bit.
|
MpegEmphasis |
getEmphasis()
Gets the emphasis.
|
int |
getFrequency()
Gets the frequency.
|
long |
getHeaderPosition()
Gets the header offset.
|
int |
getLayer()
Gets the layer description.
|
int |
getModeExtensionBits()
Gets the mode extension bits.
|
MpegAudioVersion |
getMpegAudioVersion()
Gets the MPEG audio version.
|
int |
getPaddingBit()
Gets the padding bit.
|
boolean |
getPrivateBit()
Gets a value indicating whether [private bit].
|
boolean |
isOriginal()
Gets the original bit.
|
boolean |
isProtected()
Gets
true if protected. |
addProperties, contains, findProperties, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, getPropertyDescriptors, iterator, removeProperties, sanitize, setProperties, updatePropertiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic MpegAudioPackage()
Initializes a new instance of the MpegAudioPackage class.
public final int getBitrate()
Gets the bitrate.
public final MpegChannelMode getChannelMode()
Gets the channel mode.
public final boolean getCopyright()
Gets the copyright bit.
true if copyright; otherwise, false.public final MpegEmphasis getEmphasis()
Gets the emphasis.
public final int getFrequency()
Gets the frequency.
public final long getHeaderPosition()
Gets the header offset.
public final int getLayer()
Gets the layer description. For an MP3 audio it is '3'.
public final int getModeExtensionBits()
Gets the mode extension bits.
public final MpegAudioVersion getMpegAudioVersion()
Gets the MPEG audio version. Can be MPEG-1, MPEG-2 etc.
public final int getPaddingBit()
Gets the padding bit.
public final boolean getPrivateBit()
Gets a value indicating whether [private bit].
true if [private bit]; otherwise, false.public final boolean isOriginal()
Gets the original bit.
true if audio is original; otherwise, false.public final boolean isProtected()
Gets true if protected.
true if is protected; otherwise, false.Copyright © 2025. All rights reserved.