com.icdif.audio.io
Class MP3Decoder

java.lang.Object
  extended by com.icdif.audio.io.MP3Decoder
All Implemented Interfaces:
AudioDecoder

public class MP3Decoder
extends java.lang.Object
implements AudioDecoder

An mp3 decoder that uses the tritonus library

Author:
mzechner

Constructor Summary
MP3Decoder(java.io.InputStream stream)
           
 
Method Summary
 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).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3Decoder

public MP3Decoder(java.io.InputStream stream)
           throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

readSamples

public int readSamples(float[] samples)
Description copied from interface: AudioDecoder
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.

Specified by:
readSamples in interface AudioDecoder
Parameters:
samples - The array to which it will write the samples read.
Returns:
The number of read samples.