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.
|
int |
getBadFrames() |
BitInputStream |
getBitInputStream()
Return the input but stream.
|
ChannelData[] |
getChannelData()
Return the ChannelData object.
|
long |
getSamplesDecoded()
Get the number of samples decoded.
|
StreamInfo |
getStreamInfo()
Return the parsed StreamInfo Metadata record.
|
long |
getTotalBytesRead()
Bytes read.
|
boolean |
isEOF() |
void |
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.
|
long |
seek(long samplesAbsolute)
Attempt to seek to the requested (absolute) sample position in the file.
|
public FLACDecoder(InputStream inputStream)
inputStream - The input stream to read data frompublic StreamInfo getStreamInfo()
public ChannelData[] getChannelData()
public BitInputStream getBitInputStream()
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 long seek(long samplesAbsolute)
throws IOException
samplesAbsolute - The number of samples from start of file to seek pastIOExceptionpublic Frame readNextFrame() throws IOException
IOException - on read errorpublic long getTotalBytesRead()
public Metadata readNextMetadata() throws IOException
IOException - on read errorpublic void readFrame()
throws IOException,
FrameDecodeException
IOException - On read errorFrameDecodeException - On frame decoding errorpublic long getSamplesDecoded()
public int getBadFrames()
public boolean isEOF()
Copyright © 2004–2017. All rights reserved.