|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.Storage.Sample
Class Sample
Audio sample data container
$Header: /cvsroot/marf/marf/src/marf/Storage/Sample.java,v 1.25 2004/04/20 16:38:48 mokhov Exp $
Field Summary | |
protected double[] |
adSample
Sample data array (amplitudes) |
protected int |
iArrayIndex
Chunk pointer in the sample array |
protected int |
iFormat
Sample's format |
static int |
MP3
MP3 sample format |
static int |
ULAW
ULAW sample format |
static int |
UNK
Unknown sample format |
static int |
WAV
WAVE sample format |
Constructor Summary | |
Sample()
Default constructor |
|
Sample(double[] padData)
Accepts pre-set sample for testing |
|
Sample(int piFormat)
Constructor with format indication |
Method Summary | |
int |
getAudioFormat()
|
int |
getNextChunk(double[] chunkArray)
Gets the next chunk of audio data and places it into chunkArray. |
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[] paSampleArray)
Sets the internal sample array (adSample) with the specified argument. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNK
public static final int WAV
public static final int ULAW
public static final int MP3
protected int iFormat
protected double[] adSample
protected 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
Method Detail |
public final int getAudioFormat()
public final void setAudioFormat(int piFormat) throws InvalidSampleFormatException
piFormat
- format number from the enumeration
InvalidSampleFormatException
public final void setSampleArray(double[] paSampleArray)
paSampleArray
- an array of doublespublic final double[] getSampleArray()
public final int getNextChunk(double[] chunkArray)
chunkArray
- An array of doubles
public final void resetArrayMark()
public final long getSampleSize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |