public abstract class AudioData extends NativeObject
AudioData
is an abstract representation
of audio data. There are two ways to handle audio data, short audio files
are to be stored entirely in memory, while long audio files (music) are
streamed from the hard drive as they are played.Modifier and Type | Class and Description |
---|---|
static class |
AudioData.DataType |
Modifier and Type | Field and Description |
---|---|
protected int |
bitsPerSample |
protected int |
channels |
protected int |
sampleRate |
handleRef, id, INVALID_ID, objectManager, OBJTYPE_AUDIOBUFFER, OBJTYPE_AUDIOSTREAM, OBJTYPE_BO, OBJTYPE_FILTER, OBJTYPE_FRAMEBUFFER, OBJTYPE_SHADER, OBJTYPE_SHADERSOURCE, OBJTYPE_TEXTURE, OBJTYPE_VERTEXBUFFER, updateNeeded
Modifier | Constructor and Description |
---|---|
|
AudioData() |
protected |
AudioData(int id) |
Modifier and Type | Method and Description |
---|---|
int |
getBitsPerSample() |
int |
getChannels() |
abstract AudioData.DataType |
getDataType() |
abstract float |
getDuration() |
int |
getSampleRate() |
void |
setupFormat(int channels,
int bitsPerSample,
int sampleRate)
Setup the format of the audio data.
|
clearUpdateNeeded, clone, createDestructableClone, deleteNativeBuffers, deleteObject, dispose, getId, getUniqueId, isUpdateNeeded, resetObject, setId, setUpdateNeeded, toString
protected int sampleRate
protected int channels
protected int bitsPerSample
public abstract AudioData.DataType getDataType()
Buffer
or Stream
.public abstract float getDuration()
public int getBitsPerSample()
public int getChannels()
public int getSampleRate()
public void setupFormat(int channels, int bitsPerSample, int sampleRate)
channels
- # of channels, 1 = mono, 2 = stereobitsPerSample
- Bits per sample, e.g 8 bits, 16 bits.sampleRate
- Sample rate, 44100, 22050, etc.