|
|||||||||||
| 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.SineLoader
Loads (by computing) a simple sine wave into the sample. Used for simple and quick testing of fake waves.
$Id: SineLoader.java,v 1.11 2005/06/16 19:58:55 mokhov Exp $
| Field Summary | |
static double |
DEFAULT_SINE_DEVIATION
Default sine frequency deviation of 0.1 kHz, in Hz. |
static double |
DEFAULT_SINE_FREQUENCY
Default sine frequency at 3 kHz, in Hz. |
| 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 | |
SineLoader()
Constructs default Sine Loader. |
|
| Method Summary | |
static java.lang.String |
getMARFSourceCodeRevision()
Returns source code revision information. |
long |
getSampleSize()
Retrieves the length of the sample (# of audio data in the audio stream). |
marf.Storage.Sample |
loadSample(java.io.File poInFile)
Fills in the contained sample's data array with a sine wave. |
marf.Storage.Sample |
loadSample(java.lang.String pstrFilename)
Merely calls readAudioData(). |
int |
readAudioData(double[] padSampleData)
Generates sine wave at 3 kHz +- 0.0 kHz with 8 kHz sampling rate. |
void |
saveSample(java.io.File poOutFile)
Does nothing. |
void |
saveSample(java.lang.String pstrFilename)
Does nothing. |
void |
updateSample()
Overridden to reset sample's array mark only. |
int |
writeAudioData(double[] padSample,
int piLength)
Does nothing. |
| Methods inherited from class marf.Storage.SampleLoader |
getSample, reset, setSample |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final double DEFAULT_SINE_FREQUENCY
public static final double DEFAULT_SINE_DEVIATION
| Constructor Detail |
public SineLoader()
throws InvalidSampleFormatException
InvalidSampleFormatException| Method Detail |
public final int readAudioData(double[] padSampleData)
throws StorageException
padSampleData - to fill in with sample data
StorageException
public final int writeAudioData(double[] padSample,
int piLength)
throws StorageException
padSample - used to verify the lengthpiLength - used to verify the length
StorageException - if piLength is less than zero
public marf.Storage.Sample loadSample(java.io.File poInFile)
throws StorageException
readAudioData().
poInFile - unused, can be null
StorageExceptionreadAudioData(double[])
public void saveSample(java.io.File poOutFile)
throws StorageException
poOutFile - unused, can be null
StorageException, - never thrown
StorageException - if there was an error saving the sample
public marf.Storage.Sample loadSample(java.lang.String pstrFilename)
throws StorageException
readAudioData().
loadSample in interface ISampleLoaderloadSample in class SampleLoaderpstrFilename - unused, can be null
StorageException - if readAudioData failsreadAudioData(double[])
public void saveSample(java.lang.String pstrFilename)
throws StorageException
saveSample in interface ISampleLoadersaveSample in class SampleLoaderpstrFilename - unused, can be null
StorageException, - never thrown
StorageException - if there was an error saving the sample
public void updateSample()
throws StorageException
updateSample in interface ISampleLoaderupdateSample in class SampleLoaderStorageException, - never thrown
StorageException - if there was an error updating the sample data array
public long getSampleSize()
throws StorageException
getSampleSize in interface ISampleLoadergetSampleSize in class SampleLoaderStorageException - if there was an error getting sample sizepublic static java.lang.String getMARFSourceCodeRevision()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||