Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

marf.Storage
Class SampleLoader  view SampleLoader download SampleLoader.java

java.lang.Object
  extended bymarf.Storage.SampleLoader
All Implemented Interfaces:
ISampleLoader

public abstract class SampleLoader
extends java.lang.Object
implements ISampleLoader

Absract class that provides samle loading interface. Must be overriden by a concrete sample loader.

$Id: SampleLoader.java,v 1.22 2005/06/16 19:58:54 mokhov Exp $

Since:
0.0.1
Version:
$Revision: 1.22 $

Field Summary
protected  int iRequiredBitSize
          Current bit size of a sample.
protected  int iRequiredChannels
          Current number of channels.
protected  float iRequiredFrequency
          Current frequency.
protected  javax.sound.sampled.AudioFormat oAudioFormat
          Properties of a sound sample.
protected  javax.sound.sampled.AudioInputStream oAudioInputStream
          Stream representing sound sample.
protected  java.io.ByteArrayOutputStream oByteArrayOutputStream
          Output stream used for writing audio data.
protected  Sample oSample
          Sample references of the sample to be loaded.
 
Fields inherited from interface marf.Storage.ISampleLoader
DEFAULT_CHANNELS, DEFAULT_FREQUENCY, DEFAULT_SAMPLE_BIT_SIZE, MARF_INTERFACE_CODE_REVISION
 
Constructor Summary
SampleLoader()
          Default constructor.
 
Method Summary
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 Sample getSample()
          Returns internal reference to a Sample object.
 long getSampleSize()
          Retrieves the length of the sample (# of audio data in the audio stream).
 Sample loadSample(java.lang.String pstrFilename)
          Same as loadSample(File) but takes filename as an argument.
 void reset()
          Resets the marker for the audio stream.
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface marf.Storage.ISampleLoader
loadSample, readAudioData, saveSample, writeAudioData
 

Field Detail

iRequiredBitSize

protected int iRequiredBitSize
Current bit size of a sample.


iRequiredChannels

protected int iRequiredChannels
Current number of channels.


oSample

protected Sample oSample
Sample references of the sample to be loaded.


oAudioFormat

protected javax.sound.sampled.AudioFormat oAudioFormat
Properties of a sound sample.


oAudioInputStream

protected javax.sound.sampled.AudioInputStream oAudioInputStream
Stream representing sound sample.


oByteArrayOutputStream

protected java.io.ByteArrayOutputStream oByteArrayOutputStream
Output stream used for writing audio data.


iRequiredFrequency

protected float iRequiredFrequency
Current frequency.

Since:
0.3.0
Constructor Detail

SampleLoader

public SampleLoader()
Default constructor. Instantiates ByteArrayOutputStream.

Method Detail

loadSample

public Sample loadSample(java.lang.String pstrFilename)
                  throws StorageException
Same as loadSample(File) but takes filename as an argument.

Specified by:
loadSample in interface ISampleLoader

saveSample

public void saveSample(java.lang.String pstrFilename)
                throws StorageException
Same as saveSample(File) but takes filename as an argument.

Specified by:
saveSample in interface ISampleLoader

updateSample

public void updateSample()
                  throws StorageException

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.

Specified by:
updateSample in interface ISampleLoader

reset

public void reset()
           throws StorageException
Resets the marker for the audio stream. Used after writing audio data into the sample's audio stream.

Specified by:
reset in interface ISampleLoader

getSampleSize

public long getSampleSize()
                   throws StorageException
Retrieves the length of the sample (# of audio data in the audio stream).

Specified by:
getSampleSize in interface ISampleLoader

getSample

public final Sample getSample()
Returns internal reference to a Sample object.

Specified by:
getSample in interface ISampleLoader

setSample

public final void setSample(Sample poSample)
Sets internal sample reference from outside.

Specified by:
setSample in interface ISampleLoader

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Returns source code revision information.

Since:
0.3.0