|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.farng.mp3.MP3FileHelper
public class MP3FileHelper
Helper class for MP3 files, to extract metadata directly from MPEG audio itself (not any tags embedded in file).
| Constructor Summary | |
|---|---|
protected |
MP3FileHelper()
Default constructor. |
|
MP3FileHelper(java.io.RandomAccessFile file)
Construct from a RandomAccessFile. |
| Method Summary | |
|---|---|
int |
getBitRate()
|
byte |
getEmphasis()
|
protected java.io.RandomAccessFile |
getFile()
Get the MPEG file associated with this instance. |
double |
getFrequency()
|
byte |
getLayer()
|
byte |
getMode()
|
byte |
getModeExtension()
|
byte |
getMpegVersion()
|
int |
getNumberMP3SyncFrame()
|
boolean |
isCopyProtected()
|
boolean |
isHome()
|
boolean |
isPadding()
|
boolean |
isPrivacy()
|
boolean |
isProtection()
|
boolean |
isVariableBitRate()
|
protected boolean |
parseMpegAudio()
Parse metadata from the MPEG audio stream. |
protected void |
setBitRate(int bitRate)
|
protected void |
setCopyProtected(boolean copyProtected)
|
protected void |
setEmphasis(byte emphasis)
|
protected void |
setFile(java.io.RandomAccessFile file)
Set the MPEG file associated with this instance. |
protected void |
setFrequency(double frequency)
|
protected void |
setHome(boolean home)
|
protected void |
setLayer(byte layer)
|
protected void |
setMode(byte mode)
|
protected void |
setModeExtension(byte modeExtension)
|
protected void |
setMpegVersion(byte mpegVersion)
|
void |
setNumberMP3SyncFrame(int numberMP3SyncFrame)
|
protected void |
setPadding(boolean padding)
|
protected void |
setPrivacy(boolean privacy)
|
protected void |
setProtection(boolean protection)
|
protected void |
setVariableBitRate(boolean variableBitRate)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MP3FileHelper(java.io.RandomAccessFile file)
throws java.io.IOException
file - the file
java.io.IOException - if an IO error occursprotected MP3FileHelper()
The setFile(RandomAccessFile) method must be called,
followed by parseMpegAudio(), to read the MPEG metadata
after using this constructor.
| Method Detail |
|---|
protected boolean parseMpegAudio()
throws java.io.IOException
Calling this method will position the file pointer at the start of the audio frame found.
java.io.IOException - if an IO error occursprotected java.io.RandomAccessFile getFile()
protected void setFile(java.io.RandomAccessFile file)
file - the file to setpublic int getNumberMP3SyncFrame()
public void setNumberMP3SyncFrame(int numberMP3SyncFrame)
numberMP3SyncFrame - the numberMP3SyncFrame to setpublic int getBitRate()
getBitRate in interface MP3AudioMetadatapublic boolean isCopyProtected()
isCopyProtected in interface MP3AudioMetadatapublic byte getEmphasis()
getEmphasis in interface MP3AudioMetadatapublic double getFrequency()
getFrequency in interface MP3AudioMetadatapublic boolean isHome()
isHome in interface MP3AudioMetadatapublic byte getLayer()
getLayer in interface MP3AudioMetadatapublic byte getMode()
getMode in interface MP3AudioMetadatapublic byte getModeExtension()
getModeExtension in interface MP3AudioMetadatapublic byte getMpegVersion()
getMpegVersion in interface MP3AudioMetadatapublic boolean isPadding()
isPadding in interface MP3AudioMetadatapublic boolean isPrivacy()
isPrivacy in interface MP3AudioMetadatapublic boolean isProtection()
isProtection in interface MP3AudioMetadatapublic boolean isVariableBitRate()
isVariableBitRate in interface MP3AudioMetadataprotected void setBitRate(int bitRate)
bitRate - the bitRate to setprotected void setCopyProtected(boolean copyProtected)
copyProtected - the copyProtected to setprotected void setEmphasis(byte emphasis)
emphasis - the emphasis to setprotected void setFrequency(double frequency)
frequency - the frequency to setprotected void setHome(boolean home)
home - the home to setprotected void setLayer(byte layer)
layer - the layer to setprotected void setMode(byte mode)
mode - the mode to setprotected void setModeExtension(byte modeExtension)
modeExtension - the modeExtension to setprotected void setMpegVersion(byte mpegVersion)
mpegVersion - the mpegVersion to setprotected void setPadding(boolean padding)
padding - the padding to setprotected void setPrivacy(boolean privacy)
privacy - the privacy to setprotected void setProtection(boolean protection)
protection - the protection to setprotected void setVariableBitRate(boolean variableBitRate)
variableBitRate - the variableBitRate to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||