|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.Storage.SampleLoader marf.Storage.Loaders.WAVLoader
Loads/stores samples if WAVE format.
$Id: WAVLoader.java,v 1.23 2006/01/14 22:30:13 mokhov Exp $
Field Summary |
Fields inherited from class marf.Storage.SampleLoader |
iRequiredBitSize, iRequiredChannels, iRequiredFrequency, oAudioFormat, oAudioInputStream, oByteArrayOutputStream, oSample |
Fields inherited from interface marf.Storage.ISampleLoader |
DEFAULT_CHANNELS, DEFAULT_FREQUENCY, DEFAULT_SAMPLE_BIT_SIZE, MARF_INTERFACE_CODE_REVISION |
Constructor Summary | |
WAVLoader()
WAVLoader Constructor. |
Method Summary | |
static java.lang.String |
getMARFSourceCodeRevision()
Returns source code revision information. |
Sample |
loadSample(java.io.File poInFile)
Loads WAV sample data from a file. |
int |
readAudioData(double[] padAudioData)
Buffers out the contents of an audio buffer into the parameter. |
void |
reset()
Resets the marker for the audio and byte-array streams. |
void |
saveSample(java.io.File poOutFile)
Saves the wave into a file for playback. |
void |
validateAudioFormat(javax.sound.sampled.AudioFormat poFormat)
Validates audio file stream format for WAVE files. |
int |
writeAudioData(double[] padAudioData,
int piNbrWords)
Buffers the contents of padAudioData into atAudioBuffer. |
Methods inherited from class marf.Storage.SampleLoader |
getSample, getSampleSize, loadSample, saveSample, setSample, updateSample |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WAVLoader() throws InvalidSampleFormatException
InvalidSampleFormatException
- if the WAV file isn't really in WAV format
or any other error took place.Method Detail |
public Sample loadSample(java.io.File poInFile) throws StorageException
poInFile
- incoming sample File object
StorageException
- if there was a problem loading the samplepublic final int readAudioData(double[] padAudioData) throws StorageException
padAudioData
- data array to fill in
StorageException
- if there was a problem reading the audio datapublic final int writeAudioData(double[] padAudioData, int piNbrWords) throws StorageException
padAudioData
- array of data to be writtenpiNbrWords
- number of words to be written
StorageException
- if there was an error writing audio datapublic final void saveSample(java.io.File poOutFile) throws StorageException
poOutFile
- File object for output
StorageException
- if there was an error saving samplepublic void reset() throws StorageException
reset
in interface ISampleLoader
reset
in class SampleLoader
StorageException
- if there was an error resetting the streamspublic void validateAudioFormat(javax.sound.sampled.AudioFormat poFormat) throws javax.sound.sampled.UnsupportedAudioFileException
poFormat
- the audio format to validate
javax.sound.sampled.UnsupportedAudioFileException
- if any of the three criteria are not metpublic static java.lang.String getMARFSourceCodeRevision()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |