|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--marf.Storage.Sample
Class Sample
$Header: /cvsroot/marf/marf/src/marf/Storage/Sample.java,v 1.21 2002/12/16 19:17:02 mokhov Exp $
| Field Summary | |
protected double[] |
adSample
Sample data array (amplitudes) |
protected int |
ArrayIndex
Chunk pointer in the sample array |
private static int |
HIGHEST_FORMAT
Highest possible sample format value. |
protected int |
iFormat
Sample's format |
private static int |
LOWEST_FORMAT
Lowest possible sample format value. |
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 (adSample). |
void |
setAudioFormat(int piFormat)
|
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
private static final int LOWEST_FORMAT
private static final int HIGHEST_FORMAT
protected int iFormat
protected double[] adSample
protected int ArrayIndex
| Constructor Detail |
public Sample()
public Sample(double[] padData)
padData - - preset amplitude values
public Sample(int piFormat)
throws InvalidSampleFormatException
piFormat - format number for the enumeration| Method Detail |
public int getAudioFormat()
public void setAudioFormat(int piFormat)
throws InvalidSampleFormatException
piFormat - format number from the enumeration
InvalidSampleFormatExceptionpublic void setSampleArray(double[] paSampleArray)
paSampleArray - An array of doublespublic double[] getSampleArray()
public int getNextChunk(double[] chunkArray)
throws java.lang.Exception
chunkArray - An array of doubles
java.lang.Exceptionpublic void resetArrayMark()
public long getSampleSize()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||