Package com.jogamp.openal.sound3d
Class Buffer
- java.lang.Object
-
- com.jogamp.openal.sound3d.Buffer
-
public final class Buffer extends Object
The Sound3D Buffer is a container for audio data used in the Sound3D environment.- Author:
- Athomas Goldberg, Sven Gothel, et al.
-
-
Field Summary
Fields Modifier and Type Field Description static int
FORMAT_MONO16
static int
FORMAT_MONO8
static int
FORMAT_STEREO16
static int
FORMAT_STEREO8
-
Constructor Summary
Constructors Constructor Description Buffer(int bufferID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(ByteBuffer data, int alFormat, int freq)
Configure the Sound3D buffervoid
delete()
Delete this buffer, and free its resources.int
getBitDepth()
Get the bit-depth of the data, (8 or 16)ByteBuffer
getData()
Gets the raw data contained in this buffer.int
getFrequency()
Gets the audio frequency of the data contained in this buffer.int
getID()
Return the OpenAL buffer ID, -1 if invalid.int
getNumChannels()
Get the number of channels of the data (1-Mono, 2-Stereo)int
getSize()
Gets the size (in bytes) of the raw data containe in this buffer.boolean
isValid()
Returns whethergetID()
is valid, i.e.String
toString()
-
-
-
Field Detail
-
FORMAT_MONO8
public static final int FORMAT_MONO8
- See Also:
- Constant Field Values
-
FORMAT_MONO16
public static final int FORMAT_MONO16
- See Also:
- Constant Field Values
-
FORMAT_STEREO8
public static final int FORMAT_STEREO8
- See Also:
- Constant Field Values
-
FORMAT_STEREO16
public static final int FORMAT_STEREO16
- See Also:
- Constant Field Values
-
-
Method Detail
-
getID
public int getID()
Return the OpenAL buffer ID, -1 if invalid.
-
isValid
public boolean isValid()
-
delete
public void delete()
Delete this buffer, and free its resources.
-
configure
public void configure(ByteBuffer data, int alFormat, int freq)
Configure the Sound3D buffer- Parameters:
data
- the raw audio dataalFormat
- the OpenAL format of the data, e.g.FORMAT_MONO8, FORMAT_MONO16, FORMAT_STEREO8
andFORMAT_STEREO16
freq
- the frequency of the data
-
getBitDepth
public int getBitDepth()
Get the bit-depth of the data, (8 or 16)- Returns:
- the bit-depth of the data
-
getNumChannels
public int getNumChannels()
Get the number of channels of the data (1-Mono, 2-Stereo)- Returns:
- the number of audio channels.
-
getData
public ByteBuffer getData()
Gets the raw data contained in this buffer.- Returns:
- the raw buffer data.
-
getFrequency
public int getFrequency()
Gets the audio frequency of the data contained in this buffer.- Returns:
- the frequency of the data
-
getSize
public int getSize()
Gets the size (in bytes) of the raw data containe in this buffer.- Returns:
- the size of the data.
-
-