com.icdif.audio.io
Interface AudioDecoder

All Known Implementing Classes:
MP3Decoder, WavDecoder

public interface AudioDecoder

An interface that represents a general audio decoder It's purpose is to be implemented by the wav, mp3, ogg, etc. decoders

Author:
wanderer

Method Summary
 float getSampleRate()
          Gets the sample rate of the audio to be decoded
 int readSamples(float[] samples)
          Reads in samples from the decoder and fills the array passed as parameter with the values read (It tries to read as many samples from the stream as there are elements in the array passed in).
 

Method Detail

readSamples

int readSamples(float[] samples)
Reads in samples from the decoder and fills the array passed as parameter with the values read (It tries to read as many samples from the stream as there are elements in the array passed in). Returns the actual number read in. If this number is smaller than samples.length then the end of stream has been reached. Note: In the present version, it averages from all the channels into a single channel.

Parameters:
samples - The array to which it will write the samples read.
Returns:
The number of read samples.

getSampleRate

float getSampleRate()
Gets the sample rate of the audio to be decoded

Returns:
the sample rate