|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Decoder
This object represents a decoding task. Is the base interface of the MP3 decoder object oriented API using the LAME standard API.
| Method Summary | |
|---|---|
void |
close()
Closes this decoder task. |
void |
fixWAVHeader(java.lang.String wavPath)
Modifies the header of the specified WAV file fixing invalid data saved by writeWAVHeader(OutputStream). |
mp3data_struct |
getMP3DataStruct()
Returns the mp3data_struct object with header information of the MP3 data being decoded. |
int |
getPCMDataSize()
Returns the number of bytes of PCM data decoded at the moment. |
boolean |
isClosed()
Informs whether this decoder task is closed (finished). |
boolean |
isMP3HeaderComplete()
Informs whether parsed MP3 header data is enough to build the header of a WAV file. |
void |
writeDecodedFrame(PCMFrame frame,
java.io.OutputStream output)
Writes the specified PCM frame to the specified stream. |
void |
writeWAVHeader(java.io.OutputStream output)
Writes on the specified stream a WAV header with the information provided by the mp3data_struct object of this decoding task. |
| Method Detail |
|---|
mp3data_struct getMP3DataStruct()
mp3data_structobject with header information of the MP3 data being decoded.
int getPCMDataSize()
fixWAVHeader(String)boolean isMP3HeaderComplete()
Current implementation returns false if mp3data_struct.getTotalframes()
returns 0. For instance only MP3 files with Xing header save the number of MP3 frames
contained. The total number of frames is used to calculate the data size in bytes
of the PCM data to build a WAV file.
fixWAVHeader(String)void writeWAVHeader(java.io.OutputStream output)
mp3data_struct object of this decoding task.
Even though MP3 header data is not complete, the WAV header is written
with incomplete information (PCM data size is 0). This WAV invalid header can
be fixed later calling fixWAVHeader(String) after the decoding
task finishes.
output - the stream to write the WAV header.isMP3HeaderComplete()void fixWAVHeader(java.lang.String wavPath)
writeWAVHeader(OutputStream).
You do not need this method if isMP3HeaderComplete() returns true.
This method must be called after this decoding task has finished (is closed).
The value returned by getPCMDataSize() is used to fix the WAV header.
wavPath - the path of the WAV file.
void writeDecodedFrame(PCMFrame frame,
java.io.OutputStream output)
frame - the PCM frame to save.output - the output stream to write the frame.boolean isClosed()
void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||