|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.charlesames.utility.audio.AudioSampleReader
public class AudioSampleReader
Example methods for processing audio files.
The code source is http://www.builogic.com/java/javasound-read-write.html
| Constructor Summary | |
|---|---|
AudioSampleReader(java.io.File file)
Constructor for AudioSampleReader instances |
|
| Method Summary | |
|---|---|
void |
getChannelSamples(int channel,
double[] interleavedSamples,
double[] channelSamples)
Extract samples of a particular channel. |
javax.sound.sampled.AudioFormat |
getFormat()
|
void |
getInterleavedSamples(long begin,
long end,
double[] samples)
Get the interleaved decoded samples for all channels. |
long |
getSampleCount()
|
void |
getStereoSamples(double[] leftSamples,
double[] rightSamples)
Convenience module. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AudioSampleReader(java.io.File file)
throws javax.sound.sampled.UnsupportedAudioFileException,
java.io.IOException
file - The Audio File
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException| Method Detail |
|---|
public javax.sound.sampled.AudioFormat getFormat()
public long getSampleCount()
public void getInterleavedSamples(long begin,
long end,
double[] samples)
throws java.io.IOException
begin - Starting sample index (included)end - Ending sample index (excluded). Must not exceed getSampleCount().samples - Receives the decoded samples.
java.io.IOException
java.lang.IllegalArgumentException
public void getChannelSamples(int channel,
double[] interleavedSamples,
double[] channelSamples)
channel - The desired channelinterleavedSamples - An array of interleaved samples.channelSamples - Receives the extracted samples.
public void getStereoSamples(double[] leftSamples,
double[] rightSamples)
throws java.io.IOException
leftSamples - Receives samples extracted for the left channel. Must be of size getSampleCount().rightSamples - Receives samples extracted for the right channel. Must be of size getSampleCount().
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||