public class FLACDecoder extends Object
| Constructor and Description |
|---|
FLACDecoder(InputStream inputStream)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFrameListener(FrameListener listener)
Add a frame listener.
|
void |
addPCMProcessor(PCMProcessor processor)
Add a PCM processor.
|
void |
decode()
Decode the FLAC file.
|
void |
decode(SeekPoint from,
SeekPoint to)
Decode the data frames between two seek points.
|
ByteData |
decodeFrame(Frame frame,
ByteData pcmData)
Fill the given ByteData object with PCM data from the frame.
|
void |
decodeFrames()
Decode the data frames.
|
void |
findFrameSync() |
int |
getBadFrames() |
BitInputStream |
getBitInputStream()
Return the input but stream.
|
int |
getBitsPerSample() |
int |
getBlockSize() |
int |
getChannelAssignment() |
ChannelData[] |
getChannelData()
Return the ChannelData object.
|
Frame |
getCurrentFrame()
Return the current read frame
|
int |
getLastFrameNumber() |
int |
getSampleRate() |
long |
getSamplesDecoded()
Get the number of samples decoded.
|
SeekTable |
getSeekTable() |
StreamInfo |
getStreamInfo()
Return the parsed StreamInfo Metadata record.
|
long |
getTotalBytesRead()
Bytes read.
|
VorbisComment |
getVorbisComment() |
boolean |
isEOF() |
Frame |
readFrame()
Read the next data frame.
|
Metadata[] |
readMetadata()
Read an array of metadata blocks.
|
Metadata[] |
readMetadata(StreamInfo streamInfo)
Read an array of metadata blocks.
|
Frame |
readNextFrame()
Read the next data frame.
|
Metadata |
readNextMetadata()
Read a single metadata record.
|
StreamInfo |
readStreamInfo()
Read the FLAC stream info.
|
void |
removeFrameListener(FrameListener listener)
Remove a frame listener.
|
void |
removePCMProcessor(PCMProcessor processor)
Remove a PCM processor.
|
void |
seekTo(long seekToSamples)
This will do a forward seek - backwards is not possible yet
because we would need to reset the inputstream
|
public FLACDecoder(InputStream inputStream)
inputStream - The input stream to read data frompublic StreamInfo getStreamInfo()
public SeekTable getSeekTable()
public VorbisComment getVorbisComment()
public ChannelData[] getChannelData()
public BitInputStream getBitInputStream()
public Frame getCurrentFrame()
public int getChannelAssignment()
public int getBitsPerSample()
public int getBlockSize()
public int getSampleRate()
public int getLastFrameNumber()
public long getSamplesDecoded()
public int getBadFrames()
public boolean isEOF()
public void addFrameListener(FrameListener listener)
listener - The frame listener to addpublic void removeFrameListener(FrameListener listener)
listener - The frame listener to removepublic void addPCMProcessor(PCMProcessor processor)
processor - The processor listener to addpublic void removePCMProcessor(PCMProcessor processor)
processor - The processor listener to removepublic ByteData decodeFrame(Frame frame, ByteData pcmData)
frame - the frame to send to the PCM processorspcmData - the byte data to be filled, or null if it should be allocatedspace)public StreamInfo readStreamInfo() throws IOException
IOException - On read errorpublic Metadata[] readMetadata() throws IOException
IOException - On read errorpublic Metadata[] readMetadata(StreamInfo streamInfo) throws IOException
streamInfo - The StreamInfo metadata block previously readIOException - On read errorpublic void decode()
throws IOException
IOException - On read errorpublic void decodeFrames()
throws IOException
IOException - On read errorpublic void decode(SeekPoint from, SeekPoint to) throws IOException
from - The starting seek pointto - The ending seek point (non-inclusive)IOException - On read errorpublic Frame readNextFrame() throws IOException
IOException - on read errorpublic long getTotalBytesRead()
public Metadata readNextMetadata() throws IOException
IOException - on read errorpublic void findFrameSync()
throws IOException
IOExceptionpublic Frame readFrame() throws IOException, FrameDecodeException
IOException - On read errorFrameDecodeException - On frame decoding errorpublic void seekTo(long seekToSamples)
throws IOException
seekToSamples - IOExceptionCopyright © 2014. All rights reserved.