|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.Storage.Sample
public class Sample
Audio sample data container.
$Id: Sample.java,v 1.36 2005/07/30 21:38:24 mokhov Exp $
Field Summary | |
---|---|
protected double[] |
adSample
Sample data array (amplitudes). |
static int |
DEFAULT_CHUNK_SIZE
Default sample chunk's size (128). |
static int |
DEFAULT_SAMPLE_SIZE
Default sample array's size (1024). |
protected int |
iArrayIndex
Chunk pointer in the sample array. |
Constructor Summary | |
---|---|
Sample()
Constructs default sample object. |
|
Sample(double[] padData)
Accepts pre-set sample; for testing. |
|
Sample(int piFormat)
Constructor with format indication. |
Method Summary | |
---|---|
int |
getAudioFormat()
Retrieves current sample's format. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
int |
getNextChunk(double[] padChunkArray)
Gets the next chunk of audio data and places it into padChunkArray. |
double[] |
getSampleArray()
Retrieves array containing audio data of the entire sample. |
long |
getSampleSize()
Returns the length of the sample. |
void |
resetArrayMark()
Resets the marker used for reading audio data from sample array. |
void |
setAudioFormat(int piFormat)
Sets current format of a sample. |
void |
setSampleArray(double[] padSampleArray)
Sets the internal sample array (adSample) with the specified argument. |
void |
setSampleSize(int piDesiredSize)
Sets internal size of the sample array. |
java.lang.String |
toString()
Returns textual representation of the sample object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_SAMPLE_SIZE
public static final int DEFAULT_CHUNK_SIZE
protected double[] adSample
protected transient int iArrayIndex
Constructor Detail |
---|
public Sample()
public Sample(double[] padData)
padData
- preset amplitude valuespublic Sample(int piFormat) throws InvalidSampleFormatException
piFormat
- format number for the enumeration
InvalidSampleFormatException
- if the parameter format is invalidMethod Detail |
---|
public final int getAudioFormat()
public final void setAudioFormat(int piFormat) throws InvalidSampleFormatException
piFormat
- format number from the enumeration
InvalidSampleFormatException
- if the parameter format is invalidpublic final void setSampleArray(double[] padSampleArray)
padSampleArray
- an array of doublespublic final double[] getSampleArray()
public final int getNextChunk(double[] padChunkArray)
padChunkArray
- an array of doubles
public final void resetArrayMark()
public final long getSampleSize()
public void setSampleSize(int piDesiredSize)
piDesiredSize
- new desired size of the array
java.lang.IllegalArgumentException
- if the parameter is <= 0public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |