|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.Storage.SampleLoader
Absract Class SampleLoader
Provides samle loading interface. Must be overriden by a concrete sample loader.
$Header: /cvsroot/marf/marf/src/marf/Storage/SampleLoader.java,v 1.12 2003/02/16 18:59:23 mokhov Exp $
Field Summary | |
protected javax.sound.sampled.AudioFormat |
oAudioFormat
Properties of a wave. |
protected javax.sound.sampled.AudioInputStream |
oAudioInputStream
Stream representing wave sample. |
protected java.io.ByteArrayOutputStream |
oByteArrayOutputStream
Output stream used for writing audio data. |
protected Sample |
oSample
Sample references of the sample to be loaded. |
Constructor Summary | |
SampleLoader()
Default constructor. |
Method Summary | |
Sample |
getSample()
|
long |
getSampleSize()
Retrieves the length of the sample (# of audio data in the audio stream). |
abstract Sample |
loadSample(java.io.File poFile)
SampleLoader interface. |
Sample |
loadSample(java.lang.String pstrFilename)
Same as loadSample(File) but takes filename as an argument. |
abstract int |
readAudioData(double[] paiAudioData)
Reads audio data from the sample's audio stream into paiAudioData. |
void |
reset()
Resets the marker for the audio stream. |
abstract void |
saveSample(java.io.File poFile)
SampleLoader interface. |
void |
saveSample(java.lang.String pstrFilename)
Same as saveSample(File) but takes filename as an argument. |
void |
setSample(Sample poSample)
Sets internal sample reference from outside |
void |
updateSample()
UpdateSample() is just used whenever the AudioInputStream is assigned to a new value (wave file). |
abstract int |
writeAudioData(double[] paiAudioData,
int piWords)
Writes audio data into the sample's audio stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Sample oSample
protected javax.sound.sampled.AudioFormat oAudioFormat
protected javax.sound.sampled.AudioInputStream oAudioInputStream
protected java.io.ByteArrayOutputStream oByteArrayOutputStream
Constructor Detail |
public SampleLoader()
ByteArrayOutputStream
.
Method Detail |
public abstract int readAudioData(double[] paiAudioData) throws java.lang.Exception
paiAudioData
- an array of doubles
java.lang.Exception
public abstract int writeAudioData(double[] paiAudioData, int piWords) throws java.lang.Exception
paiAudioData
- an array of doublespiWords
- the number of audio data to written from the paiAudiodata
java.lang.Exception
public abstract Sample loadSample(java.io.File poFile) throws java.lang.Exception
poFile
- file object a sample to be read from
java.lang.Exception
public Sample loadSample(java.lang.String pstrFilename) throws java.lang.Exception
pstrFilename
- filename of a sample to be read from
java.lang.Exception
public abstract void saveSample(java.io.File poFile) throws java.lang.Exception
poFile
- File object a sample to be saved to
java.lang.Exception
public void saveSample(java.lang.String pstrFilename) throws java.lang.Exception
pstrFilename
- filename of a sample to be saved to
java.lang.Exception
public final void updateSample() throws java.lang.Exception
UpdateSample()
is just used whenever the AudioInputStream
is assigned to a new value (wave file).
Then you would simply call this method to update the
Sample
member with the contents of the new AudioInputStream
.
java.lang.Exception
public final void reset() throws java.lang.Exception
java.lang.Exception
public final long getSampleSize() throws java.lang.Exception
java.lang.Exception
public final Sample getSample()
public final void setSample(Sample poSample)
poSample
- Sample object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |