|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.farng.mp3.AbstractMP3FileItem org.farng.mp3.AbstractMP3FragmentBody org.farng.mp3.id3.AbstractID3v2FrameBody org.farng.mp3.id3.FrameBodyASPI
Audio files with variable bit rates are intrinsically difficult to
deal with in the
case of seeking within the file. The ASPI frame
makes seeking easier by providing a list a seek
points within the
audio file. The seek points are a fractional offset within the audio
data, providing a starting point from which to find an appropriate
<Header for 'Seek Point Index', ID: "ASPI">
Indexed data start (S) $xx xx xx xx
Indexed data length (L) $xx xx xx xx
Number of
index points (N) $xx xx
Then for every index point the following data is included;
Fraction at index (Fi) $xx (xx)
'Indexed data start' is a byte offset from the beginning of the file.
'Indexed data
length' is the byte length of the audio data being
indexed. 'Number of index points' is the number
of index points, as
the name implies. The recommended number is 100. 'Bits per index
point' is 8 or 16, depending on the chosen precision. 8 bits works
Here are the algorithms to be used in the calculation. The known data
must be the
offset of the start of the indexed data (S), the offset
of the end of the indexed data (E), the
number of index points (N),
the offset at index i (Oi). We calculate the fraction at index i
(Fi).
Oi is the offset of the frame whose start is soonest after the point
for which the
time offset is (i/N * duration).
The frame data should be calculated as follows:
Fi = Oi/L * 2^b (rounded down to the nearest integer)
Offset calculation should be calculated as follows from data in the
frame:
Oi = (Fi/2^b)*L (rounded up to the nearest integer)
Constructor Summary | |
FrameBodyASPI()
Creates a new FrameBodyASPI object. |
|
FrameBodyASPI(FrameBodyASPI copyObject)
Creates a new FrameBodyASPI object. |
|
FrameBodyASPI(int dataStart,
int dataLength,
int indexPoints,
int bitsPerPoint,
short[] fraction)
Creates a new FrameBodyASPI object. |
|
FrameBodyASPI(java.io.RandomAccessFile file)
Creates a new FrameBodyASPI object. |
Method Summary | |
void |
equals()
This method is not yet supported. |
java.lang.String |
getIdentifier()
ID string that usually corresponds to the class name, but can be displayed to the user. |
int |
getSize()
Returns the estimated size in bytes of this object if it was to be written to file. |
void |
read(java.io.RandomAccessFile file)
Read the data from the given file into this object. |
protected void |
setupObjectList()
Create the order of MP3Object objects that this body expects. |
java.lang.String |
toString()
Calls toString for all MP3Object objects and creates a string with a new line
character. |
void |
write(java.io.RandomAccessFile file)
Write the contents of this object to the file at the position it is currently at. |
Methods inherited from class org.farng.mp3.id3.AbstractID3v2FrameBody |
equals, readHeader, writeHeader |
Methods inherited from class org.farng.mp3.AbstractMP3FragmentBody |
appendToObjectList, getBriefDescription, getDescription, getObject, getObjectListIterator, has6ByteHeader, isSubsetOf, iterator, setObject |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FrameBodyASPI()
public FrameBodyASPI(FrameBodyASPI copyObject)
public FrameBodyASPI(int dataStart, int dataLength, int indexPoints, int bitsPerPoint, short[] fraction)
public FrameBodyASPI(java.io.RandomAccessFile file) throws java.io.IOException, InvalidTagException
Method Detail |
public java.lang.String getIdentifier()
AbstractMP3FileItem
getIdentifier
in class AbstractMP3FileItem
public int getSize()
AbstractMP3FragmentBody
getSize
in class AbstractMP3FragmentBody
public void equals()
java.lang.UnsupportedOperationException
- This method is not yet supportedprotected void setupObjectList()
AbstractMP3FragmentBody
MP3Object
objects that this body expects. This method needs to be overwritten.
setupObjectList
in class AbstractMP3FragmentBody
public void read(java.io.RandomAccessFile file) throws java.io.IOException, InvalidTagException
AbstractMP3FragmentBody
read
in class AbstractMP3FragmentBody
file
- file to read from
InvalidTagException
- if there is any error in the data format.
java.io.IOException
- on any I/O errorpublic java.lang.String toString()
AbstractMP3FragmentBody
toString
for all MP3Object
objects and creates a string with a new line
character.
toString
in class AbstractMP3FragmentBody
public void write(java.io.RandomAccessFile file) throws java.io.IOException
AbstractMP3FragmentBody
write
in class AbstractMP3FragmentBody
file
- destination file
java.io.IOException
- on any I/O error
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |