|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.icdif.audio.io.WavDecoder
public class WavDecoder
This class implements the AudioDecoder Interface and is responsible for decoding the audio data from a wave file, i.e. transforming the bytes in pcm format to arrays of float that we can easily analyze and plot.
Constructor Summary | |
---|---|
WavDecoder(java.io.InputStream stream)
Constructor that initializes the stream from where we read the pcm data. |
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). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WavDecoder(java.io.InputStream stream) throws java.lang.Exception
stream
- The Wave file as a stream
java.lang.Exception
- When it's not possible to read from the fileMethod Detail |
---|
public int readSamples(float[] samples)
AudioDecoder
readSamples
in interface AudioDecoder
samples
- The array to which it will write the samples read.
public float getSampleRate()
AudioDecoder
getSampleRate
in interface AudioDecoder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |