public final class AL10
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
AL_BITS
Sound buffers: The number of bits per sample for the
data contained in the buffer.
|
static int |
AL_BUFFER
Indicate the buffer to provide sound samples.
|
static int |
AL_BUFFERS_PROCESSED
Buffer Queue params
|
static int |
AL_BUFFERS_QUEUED
Buffer Queue params
|
static int |
AL_CHANNEL_MASK
Specify the channel mask.
|
static int |
AL_CHANNELS
Sound buffers: The number of channels for the data
contained in the buffer.
|
static int |
AL_CONE_INNER_ANGLE
Directional source, inner cone angle, in degrees
Range: [0-360]
Default: 360
|
static int |
AL_CONE_OUTER_ANGLE
Directional source, outer cone angle, in degrees.
|
static int |
AL_CONE_OUTER_GAIN
Indicate the gain (volume amplification) applied.
|
static int |
AL_DATA
Deprecated.
This token is a relict of the early OpenAL days and is
no longer supported. Neither the OpenAL spec nor OpenAL Soft define
it.
|
static int |
AL_DIRECTION
Specify the current direction as forward vector.
|
static int |
AL_DISTANCE_MODEL
Distance model.
|
static int |
AL_DOPPLER_FACTOR
Doppler scale.
|
static int |
AL_DOPPLER_VELOCITY
Doppler velocity.
|
static int |
AL_EXTENSIONS
Context strings: Extensions
|
static int |
AL_FALSE
Boolean False
|
static int |
AL_FORMAT_MONO16
Sound buffers: format specifier.
|
static int |
AL_FORMAT_MONO8
Sound buffers: format specifier.
|
static int |
AL_FORMAT_STEREO16
Sound buffers: format specifier.
|
static int |
AL_FORMAT_STEREO8
Sound buffers: format specifier.
|
static int |
AL_FORMAT_VORBIS_EXT
Ogg Vorbis format specifier.
|
static int |
AL_FREQUENCY
Sound buffers: frequency, in units of Hertz [Hz].
|
static int |
AL_GAIN
Indicate the gain (volume amplification) applied.
|
static int |
AL_INITIAL
Source state information
|
static int |
AL_INVALID
Bad value
|
static int |
AL_INVALID_ENUM
Illegal enum passed as an argument to an AL call.
|
static int |
AL_INVALID_NAME
Illegal name passed as an argument to an AL call.
|
static int |
AL_INVALID_OPERATION
A function was called at inappropriate time,
or in an inappropriate way, causing an illegal state.
|
static int |
AL_INVALID_VALUE
Illegal value passed as an argument to an AL call.
|
static int |
AL_INVERSE_DISTANCE
Distance model
|
static int |
AL_INVERSE_DISTANCE_CLAMPED
Distance model
|
static int |
AL_LOOPING
Indicate whether source has to loop infinite.
|
static int |
AL_MAX_DISTANCE
Specify the maximum distance.
|
static int |
AL_MAX_GAIN
Indicate maximum source attenuation.
|
static int |
AL_MIN_GAIN
Indicate minimum source attenuation.
|
static int |
AL_NO_ERROR
Errors: No Error.
|
static int |
AL_NONE
Disable value
|
static int |
AL_ORIENTATION
Specify the current orientation.
|
static int |
AL_OUT_OF_MEMORY
A function could not be completed,
because there is not enough memory available.
|
static int |
AL_PAUSED
Source state information
|
static int |
AL_PENDING
Buffer state.
|
static int |
AL_PITCH
Specify the pitch to be applied, either at source,
or on mixer results, at listener.
|
static int |
AL_PLAYING
Source state information
|
static int |
AL_POSITION
Specify the current location in three dimensional space.
|
static int |
AL_PROCESSED
Buffer state.
|
static int |
AL_REFERENCE_DISTANCE
Specify the current orientation.
|
static int |
AL_RENDERER
Context strings: Renderer
|
static int |
AL_ROLLOFF_FACTOR
Indicate the rolloff factor for the source.
|
static int |
AL_SIZE
Sound buffers: Size in bytes of the buffer data.
|
static int |
AL_SOURCE_ABSOLUTE
Indicate source has absolute coordinates
|
static int |
AL_SOURCE_RELATIVE
Indicate Source has listener relative coordinates
|
static int |
AL_SOURCE_STATE
Source state information
|
static int |
AL_SOURCE_TYPE
Indicate the type of SOURCE.
|
static int |
AL_STOPPED
Source state information
|
static int |
AL_TRUE
Boolean True
|
static int |
AL_UNUSED
Buffer state.
|
static int |
AL_VELOCITY
Specify the current velocity in three dimensional space.
|
static int |
AL_VENDOR
Context strings: Vendor
|
static int |
AL_VERSION
Context strings: Version
|
Modifier and Type | Method and Description |
---|---|
static void |
alBufferData(int buffer,
int format,
java.nio.ByteBuffer data,
int freq)
A special case of Buffer state is the actual sound sample data stored in asociation
with the Buffer.
|
static void |
alBufferData(int buffer,
int format,
java.nio.IntBuffer data,
int freq)
A special case of Buffer state is the actual sound sample data stored in asociation
with the Buffer.
|
static void |
alBufferData(int buffer,
int format,
java.nio.ShortBuffer data,
int freq)
A special case of Buffer state is the actual sound sample data stored in asociation
with the Buffer.
|
static void |
alDeleteBuffers(int buffer)
Overloads alDeleteBuffers.
|
static void |
alDeleteBuffers(java.nio.IntBuffer buffers)
The application requests deletion of a number of Buffers by calling DeleteBuffers.
|
static void |
alDeleteSources(int source)
Overloads alDeleteSources.
|
static void |
alDeleteSources(java.nio.IntBuffer sources)
The application requests deletion of a number of Sources by DeleteSources.
|
static void |
alDisable(int capability)
The application can temporarily disable certain AL capabilities on a per Context
basis.
|
static void |
alDistanceModel(int value)
Samples usually use the entire dynamic range of the chosen format/encoding,
independent of their real world intensity.
|
static void |
alDopplerFactor(float value)
The Doppler Effect depends on the velocities of Source and Listener relative to the
medium, and the propagation speed of sound in that medium.
|
static void |
alDopplerVelocity(float value)
The Doppler Effect depends on the velocities of Source and Listener relative to the
medium, and the propagation speed of sound in that medium.
|
static void |
alEnable(int capability)
The application can temporarily disable certain AL capabilities on a per Context
basis.
|
static int |
alGenBuffers()
Overloads alGenBuffers.
|
static void |
alGenBuffers(java.nio.IntBuffer buffers)
The application requests a number of Buffers using GenBuffers.
|
static int |
alGenSources()
Overloads alGenSources.
|
static void |
alGenSources(java.nio.IntBuffer sources)
The application requests a number of Sources using GenSources.
|
static boolean |
alGetBoolean(int pname)
Like OpenGL, AL uses a simplified interface for querying global state.
|
static float |
alGetBufferf(int buffer,
int pname)
Buffer state is maintained inside the AL implementation and can be queried in full.
ALC_FREQUENCY - specified in samples per second, i.e. |
static int |
alGetBufferi(int buffer,
int pname)
Buffer state is maintained inside the AL implementation and can be queried in full.
ALC_FREQUENCY - specified in samples per second, i.e. |
static double |
alGetDouble(int pname)
Like OpenGL, AL uses a simplified interface for querying global state.
|
static void |
alGetDouble(int pname,
java.nio.DoubleBuffer data)
Like OpenGL, AL uses a simplified interface for querying global state.
|
static int |
alGetEnumValue(java.lang.String ename)
To obtain enumeration values for extensions, the application has to use
GetEnumValue of an extension token.
|
static int |
alGetError()
The AL detects only a subset of those conditions that could be considered errors.
|
static float |
alGetFloat(int pname)
Like OpenGL, AL uses a simplified interface for querying global state.
|
static void |
alGetFloat(int pname,
java.nio.FloatBuffer data)
Like OpenGL, AL uses a simplified interface for querying global state.
|
static int |
alGetInteger(int pname)
Like OpenGL, AL uses a simplified interface for querying global state.
|
static void |
alGetInteger(int pname,
java.nio.IntBuffer data)
Like OpenGL, AL uses a simplified interface for querying global state.
|
static void |
alGetListener(int pname,
java.nio.FloatBuffer floatdata)
Listener state is maintained inside the AL implementation and can be queried in
full.
|
static float |
alGetListenerf(int pname)
Listener state is maintained inside the AL implementation and can be queried in
full.
|
static int |
alGetListeneri(int pname)
Listener state is maintained inside the AL implementation and can be queried in
full.
|
static void |
alGetSource(int source,
int pname,
java.nio.FloatBuffer floatdata)
Source state is maintained inside the AL implementation, and the current attributes
can be queried.
|
static float |
alGetSourcef(int source,
int pname)
Source state is maintained inside the AL implementation, and the current attributes
can be queried.
|
static int |
alGetSourcei(int source,
int pname)
Source state is maintained inside the AL implementation, and the current attributes
can be queried.
|
static java.lang.String |
alGetString(int pname)
The application can retrieve state information global to the current AL Context.
|
static boolean |
alIsBuffer(int buffer)
The application can verify whether a buffer Name is valid using the IsBuffer query.
|
static boolean |
alIsEnabled(int capability)
The application can also query whether a given capability is currently enabled or
not.
|
static boolean |
alIsExtensionPresent(java.lang.String fname)
To verify that a given extension is available for the current context and the device it
is associated with, use this method.
|
static boolean |
alIsSource(int id)
The application can verify whether a source name is valid using the IsSource query.
|
static void |
alListener(int pname,
java.nio.FloatBuffer value)
Listener attributes are changed using the Listener group of commands.
|
static void |
alListener3f(int pname,
float v1,
float v2,
float v3)
Listener attributes are changed using the Listener group of commands.
|
static void |
alListenerf(int pname,
float value)
Listener attributes are changed using the Listener group of commands.
|
static void |
alListeneri(int pname,
int value)
Listener attributes are changed using the Listener group of commands.
|
static void |
alSource(int source,
int pname,
java.nio.FloatBuffer value)
Specifies the position and other properties as taken into account during
sound processing.
|
static void |
alSource3f(int source,
int pname,
float v1,
float v2,
float v3)
Specifies the position and other properties as taken into account during
sound processing.
|
static void |
alSourcef(int source,
int pname,
float value)
Specifies the position and other properties as taken into account during
sound processing.
|
static void |
alSourcei(int source,
int pname,
int value)
Specifies the position and other properties as taken into account during
sound processing.
|
static void |
alSourcePause(int source)
Pause() applied to an AL_INITIAL Source is a legal NOP.
|
static void |
alSourcePause(java.nio.IntBuffer sources)
Pause() applied to an AL_INITIAL Source is a legal NOP.
|
static void |
alSourcePlay(int source)
Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus
the data found in the Buffer will be fed into the processing, starting at the
beginning.
|
static void |
alSourcePlay(java.nio.IntBuffer sources)
Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus
the data found in the Buffer will be fed into the processing, starting at the
beginning.
|
static void |
alSourceQueueBuffers(int source,
int buffer)
Overloads alSourceQueueBuffers.
|
static void |
alSourceQueueBuffers(int source,
java.nio.IntBuffer buffers)
The application can queue up one or multiple buffer names using
SourceQueueBuffers.
|
static void |
alSourceRewind(int source)
Rewind() applied to an AL_INITIAL Source is a legal NOP.
|
static void |
alSourceRewind(java.nio.IntBuffer sources)
Rewind() applied to an AL_INITIAL Source is a legal NOP.
|
static void |
alSourceStop(int source)
Stop() applied to an AL_INITIAL Source is a legal NOP.
|
static void |
alSourceStop(java.nio.IntBuffer sources)
Stop() applied to an AL_INITIAL Source is a legal NOP.
|
static int |
alSourceUnqueueBuffers(int source)
Overloads alSourceUnqueueBuffers.
|
static void |
alSourceUnqueueBuffers(int source,
java.nio.IntBuffer buffers)
Once a queue entry for a buffer has been appended to a queue and is pending
processing, it should not be changed.
|
public static final int AL_INVALID
public static final int AL_NONE
public static final int AL_FALSE
public static final int AL_TRUE
public static final int AL_SOURCE_TYPE
public static final int AL_SOURCE_ABSOLUTE
public static final int AL_SOURCE_RELATIVE
public static final int AL_CONE_INNER_ANGLE
public static final int AL_CONE_OUTER_ANGLE
public static final int AL_PITCH
public static final int AL_POSITION
public static final int AL_DIRECTION
public static final int AL_VELOCITY
public static final int AL_LOOPING
public static final int AL_BUFFER
public static final int AL_GAIN
public static final int AL_MIN_GAIN
public static final int AL_MAX_GAIN
public static final int AL_ORIENTATION
public static final int AL_REFERENCE_DISTANCE
public static final int AL_ROLLOFF_FACTOR
public static final int AL_CONE_OUTER_GAIN
public static final int AL_MAX_DISTANCE
public static final int AL_CHANNEL_MASK
public static final int AL_SOURCE_STATE
public static final int AL_INITIAL
public static final int AL_PLAYING
public static final int AL_PAUSED
public static final int AL_STOPPED
public static final int AL_BUFFERS_QUEUED
public static final int AL_BUFFERS_PROCESSED
public static final int AL_FORMAT_MONO8
public static final int AL_FORMAT_MONO16
public static final int AL_FORMAT_STEREO8
public static final int AL_FORMAT_STEREO16
public static final int AL_FORMAT_VORBIS_EXT
public static final int AL_FREQUENCY
public static final int AL_BITS
public static final int AL_CHANNELS
public static final int AL_SIZE
public static final int AL_DATA
public static final int AL_UNUSED
Not supported for public use (yet).
public static final int AL_PENDING
Not supported for public use (yet).
public static final int AL_PROCESSED
Not supported for public use (yet).
public static final int AL_NO_ERROR
public static final int AL_INVALID_NAME
public static final int AL_INVALID_ENUM
public static final int AL_INVALID_VALUE
public static final int AL_INVALID_OPERATION
public static final int AL_OUT_OF_MEMORY
public static final int AL_VENDOR
public static final int AL_VERSION
public static final int AL_RENDERER
public static final int AL_EXTENSIONS
public static final int AL_DOPPLER_FACTOR
public static final int AL_DOPPLER_VELOCITY
public static final int AL_DISTANCE_MODEL
public static final int AL_INVERSE_DISTANCE
public static final int AL_INVERSE_DISTANCE_CLAMPED
public static void alEnable(int capability)
capability
- name of a capability to enablepublic static void alDisable(int capability)
capability
- name of a capability to disablepublic static boolean alIsEnabled(int capability)
If the token used to specify target is not legal, an AL_INVALID_ENUM error will be generated.
At this time, this mechanism is not used. There are no valid targets.
capability
- name of a capability to checkpublic static boolean alGetBoolean(int pname)
Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, AL_DISTANCE_MODEL.
null
destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
in specifying pName. The amount of memory required in the destination
depends on the actual state requested.
public static int alGetInteger(int pname)
Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, AL_DISTANCE_MODEL.
null
destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
in specifying pName. The amount of memory required in the destination
depends on the actual state requested.
public static float alGetFloat(int pname)
Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, AL_DISTANCE_MODEL.
null
destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
in specifying pName. The amount of memory required in the destination
depends on the actual state requested.
public static double alGetDouble(int pname)
Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, AL_DISTANCE_MODEL.
null
destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
in specifying pName. The amount of memory required in the destination
depends on the actual state requested.
public static void alGetInteger(int pname, java.nio.IntBuffer data)
Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, AL_DISTANCE_MODEL.
null
destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
in specifying pName. The amount of memory required in the destination
depends on the actual state requested.
pname
- state to be querieddata
- Buffer to place the integers inpublic static void alGetFloat(int pname, java.nio.FloatBuffer data)
Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, AL_DISTANCE_MODEL.
null
destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
in specifying pName. The amount of memory required in the destination
depends on the actual state requested.
pname
- state to be querieddata
- Buffer to place the floats inpublic static void alGetDouble(int pname, java.nio.DoubleBuffer data)
Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, AL_DISTANCE_MODEL.
null
destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
in specifying pName. The amount of memory required in the destination
depends on the actual state requested.
pname
- state to be querieddata
- Buffer to place the doubles inpublic static java.lang.String alGetString(int pname)
pname
- The property to be returnedpublic static int alGetError()
Each detectable error is assigned a numeric code. When an error is detected by AL, a flag is set and the error code is recorded. Further errors, if they occur, do not affect this recorded code. When GetError is called, the code is returned and the flag is cleared, so that a further error will again record its code. If a call to GetError returns AL_NO_ERROR then there has been no detectable error since the last call to GetError (or since the AL was initialized).
Error codes can be mapped to strings. The GetString function returns a pointer to a constant (literal) string that is identical to the identifier used for the enumeration value, as defined in the specification.
AL_NO_ERROR - "No Error" token.
AL_INVALID_NAME - Invalid Name parameter.
AL_INVALID_ENUM - Invalid parameter.
AL_INVALID_VALUE - Invalid enum parameter value.
AL_INVALID_OPERATION - Illegal call.
AL_OUT_OF_MEMORY - Unable to allocate memory.
The table summarizes the AL errors. Currently, when an error flag is set, results of AL operations are undefined only if AL_OUT_OF_MEMORY has occured. In other cases, the command generating the error is ignored so that it has no effect on AL state or output buffer contents. If the error generating command returns a value, it returns zero. If the generating command modifies values through a pointer argument, no change is made to these values. These error semantics apply only to AL errors, not to system errors such as memory access errors.
Several error generation conditions are implicit in the description of the various AL commands. First, if a command that requires an enumerated value is passed a value that is not one of those specified as allowable for that command, the error AL_INVALID_ENUM results. This is the case even if the argument is a pointer to a symbolic constant if that value is not allowable for the given command. This will occur whether the value is allowable for other functions, or an invalid integer value.
Integer parameters that are used as names for AL objects such as Buffers and Sources are checked for validity. If an invalid name parameter is specified in an AL command, an AL_INVALID_NAME error will be generated, and the command is ignored.
If a negative integer is provided where an argument of type sizei is specified, the error AL_INVALID_VALUE results. The same error will result from attempts to set integral and floating point values for attributes exceeding the legal range for these. The specification does not guarantee that the implementation emits AL_INVALID_VALUE if a NaN or Infinity value is passed in for a float or double argument (as the specification does not enforce possibly expensive testing of floating point values).
Commands can be invalid. For example, certain commands might not be applicable to a given object. There are also illegal combinations of tokens and values as arguments to a command. AL responds to any such illegal command with an AL_INVALID_OPERATION error.
If memory is exhausted as a side effect of the execution of an AL command, either on system level or by exhausting the allocated resources at AL's internal disposal, the error AL_OUT_OF_MEMORY may be generated. This can also happen independent of recent commands if AL has to request memory for an internal task and fails to allocate the required memory from the operating system.
Otherwise errors are generated only for conditions that are explicitely described in this specification.
public static boolean alIsExtensionPresent(java.lang.String fname)
A null
name argument returns AL_FALSE, as do invalid and unsupported string
tokens. A null
deviceHandle will result in an INVALID_DEVICE error.
fname
- String describing the desired extensionpublic static int alGetEnumValue(java.lang.String ename)
To obtain enumeration values for extensions, the application has to use GetEnumValue of an extension token. Enumeration values are defined within the AL namespace and allocated according to specification of the core API and the extensions, thus they are context-independent.
Returns 0 if the enumeration can not be found. The presence of an enum value does not guarantee the applicability of an extension to the current context. A non-zero return indicates merely that the implementation is aware of the existence of this extension. Implementations should not attempt to return 0 to indicate that the extensions is not supported for the current context.
ename
- String describing an OpenAL enumpublic static void alListeneri(int pname, int value)
pname
- name of the attribute to be setvalue
- value to set the attribute topublic static void alListenerf(int pname, float value)
pname
- name of the attribute to be setvalue
- floating point value to set the attribute topublic static void alListener(int pname, java.nio.FloatBuffer value)
pname
- name of the attribute to be setvalue
- FloatBuffer containing value to set the attribute topublic static void alListener3f(int pname, float v1, float v2, float v3)
pname
- name of the attribute to be setv1
- value value 1v2
- value value 2v3
- float value 3public static int alGetListeneri(int pname)
pname
- name of the attribute to be retrievedpublic static float alGetListenerf(int pname)
pname
- name of the attribute to be retrievedpublic static void alGetListener(int pname, java.nio.FloatBuffer floatdata)
pname
- name of the attribute to be retrievedfloatdata
- Buffer to write floats topublic static void alGenSources(java.nio.IntBuffer sources)
sources
- array holding sourcespublic static int alGenSources()
public static void alDeleteSources(java.nio.IntBuffer sources)
sources
- Source array to delete frompublic static void alDeleteSources(int source)
public static boolean alIsSource(int id)
id
- id of source to be testes for validitypublic static void alSourcei(int source, int pname, int value)
source
- Source to det property onpname
- property to setvalue
- value of propertypublic static void alSourcef(int source, int pname, float value)
source
- Source to det property onpname
- property to setvalue
- value of propertypublic static void alSource(int source, int pname, java.nio.FloatBuffer value)
source
- Source to set property onpname
- property to setvalue
- FloatBuffer containing value of propertypublic static void alSource3f(int source, int pname, float v1, float v2, float v3)
source
- Source to set property onpname
- property to setv1
- value 1 of propertyv2
- value 2 of propertyv3
- value 3 of propertypublic static int alGetSourcei(int source, int pname)
source
- source to get property frompname
- name of propertypublic static float alGetSourcef(int source, int pname)
source
- source to get property frompname
- name of propertypublic static void alGetSource(int source, int pname, java.nio.FloatBuffer floatdata)
source
- Source to get property frompname
- property to getfloatdata
- Buffer to write floats topublic static void alSourcePlay(java.nio.IntBuffer sources)
sources
- array of sources to playpublic static void alSourcePause(java.nio.IntBuffer sources)
sources
- array of sources to pausepublic static void alSourceStop(java.nio.IntBuffer sources)
sources
- array of sources to stoppublic static void alSourceRewind(java.nio.IntBuffer sources)
sources
- array of sources to rewindpublic static void alSourcePlay(int source)
source
- Source to playpublic static void alSourcePause(int source)
source
- Source to pausepublic static void alSourceStop(int source)
source
- Source to stoppublic static void alSourceRewind(int source)
source
- Source to rewindpublic static void alGenBuffers(java.nio.IntBuffer buffers)
buffers
- holding bufferspublic static int alGenBuffers()
public static void alDeleteBuffers(java.nio.IntBuffer buffers)
The application requests deletion of a number of Buffers by calling DeleteBuffers.
Once deleted, Names are no longer valid for use with AL function calls. Any such use will cause an AL_INVALID_NAME error. The implementation is free to defer actual release of resources.
IsBuffer(bname) can be used to verify deletion of a buffer. Deleting bufferName 0 is a legal NOP in both scalar and vector forms of the command. The same is true for unused buffer names, e.g. such as not allocated yet, or as released already.
buffers
- Buffer to delete frompublic static void alDeleteBuffers(int buffer)
public static boolean alIsBuffer(int buffer)
buffer
- buffer to be tested for validitypublic static void alBufferData(int buffer, int format, java.nio.ByteBuffer data, int freq)
A special case of Buffer state is the actual sound sample data stored in asociation with the Buffer. Applications can specify sample data using BufferData.
The data specified is copied to an internal software, or if possible, hardware buffer. The implementation is free to apply decompression, conversion, resampling, and filtering as needed. The internal format of the Buffer is not exposed to the application, and not accessible. Valid formats are AL_FORMAT_MONO8, AL_FORMAT_MONO16, AL_FORMAT_STEREO8, and AL_FORMAT_STEREO16. An implementation may expose other formats, see the chapter on Extensions for information on determining if additional formats are supported.
Applications should always check for an error condition after attempting to specify buffer data in case an implementation has to generate an AL_OUT_OF_MEMORY or conversion related AL_INVALID_VALUE error. The application is free to reuse the memory specified by the data pointer once the call to BufferData returns. The implementation has to dereference, e.g. copy, the data during BufferData execution.
buffer
- Buffer to fillformat
- format sound data is indata
- location of datafreq
- frequency of datapublic static void alBufferData(int buffer, int format, java.nio.IntBuffer data, int freq)
A special case of Buffer state is the actual sound sample data stored in asociation with the Buffer. Applications can specify sample data using BufferData.
The data specified is copied to an internal software, or if possible, hardware buffer. The implementation is free to apply decompression, conversion, resampling, and filtering as needed. The internal format of the Buffer is not exposed to the application, and not accessible. Valid formats are AL_FORMAT_MONO8, AL_FORMAT_MONO16, AL_FORMAT_STEREO8, and AL_FORMAT_STEREO16. An implementation may expose other formats, see the chapter on Extensions for information on determining if additional formats are supported.
Applications should always check for an error condition after attempting to specify buffer data in case an implementation has to generate an AL_OUT_OF_MEMORY or conversion related AL_INVALID_VALUE error. The application is free to reuse the memory specified by the data pointer once the call to BufferData returns. The implementation has to dereference, e.g. copy, the data during BufferData execution.
buffer
- Buffer to fillformat
- format sound data is indata
- location of datafreq
- frequency of datapublic static void alBufferData(int buffer, int format, java.nio.ShortBuffer data, int freq)
A special case of Buffer state is the actual sound sample data stored in asociation with the Buffer. Applications can specify sample data using BufferData.
The data specified is copied to an internal software, or if possible, hardware buffer. The implementation is free to apply decompression, conversion, resampling, and filtering as needed. The internal format of the Buffer is not exposed to the application, and not accessible. Valid formats are AL_FORMAT_MONO8, AL_FORMAT_MONO16, AL_FORMAT_STEREO8, and AL_FORMAT_STEREO16. An implementation may expose other formats, see the chapter on Extensions for information on determining if additional formats are supported.
Applications should always check for an error condition after attempting to specify buffer data in case an implementation has to generate an AL_OUT_OF_MEMORY or conversion related AL_INVALID_VALUE error. The application is free to reuse the memory specified by the data pointer once the call to BufferData returns. The implementation has to dereference, e.g. copy, the data during BufferData execution.
buffer
- Buffer to fillformat
- format sound data is indata
- location of datafreq
- frequency of datapublic static int alGetBufferi(int buffer, int pname)
buffer
- buffer to get property frompname
- name of property to retrievepublic static float alGetBufferf(int buffer, int pname)
buffer
- buffer to get property frompname
- name of property to retrievepublic static void alSourceQueueBuffers(int source, java.nio.IntBuffer buffers)
The application can queue up one or multiple buffer names using SourceQueueBuffers. The buffers will be queued in the sequence in which they appear in the array.
This command is legal on a Source in any state (to allow for streaming, queueing has to be possible on a AL_PLAYING Source). Queues are read-only with exception of the unqueue operation. The Buffer Name AL_NONE (i.e. 0) can be queued.
source
- source to queue buffers ontobuffers
- buffers to be queuedpublic static void alSourceQueueBuffers(int source, int buffer)
public static void alSourceUnqueueBuffers(int source, java.nio.IntBuffer buffers)
Once a queue entry for a buffer has been appended to a queue and is pending processing, it should not be changed. Removal of a given queue entry is not possible unless either the Source is AL_STOPPED (in which case then entire queue is considered processed), or if the queue entry has already been processed (AL_PLAYING or AL_PAUSED Source).
The Unqueue command removes a number of buffers entries that have finished processing, in the order of appearance, from the queue. The operation will fail if more buffers are requested than available, leaving the destination arguments unchanged. An AL_INVALID_VALUE error will be thrown. If no error, the destination argument will have been updated accordingly.
source
- source to unqueue buffers frombuffers
- IntBuffer containing list of names that were unqueuedpublic static int alSourceUnqueueBuffers(int source)
public static void alDistanceModel(int value)
Samples usually use the entire dynamic range of the chosen format/encoding, independent of their real world intensity. In other words, a jet engine and a clockwork both will have samples with full amplitude. The application will then have to adjust Source AL_GAIN accordingly to account for relative differences.
Source AL_GAIN is then attenuated by distance. The effective attenuation of a Source depends on many factors, among which distance attenuation and source and Listener AL_GAIN are only some of the contributing factors. Even if the source and Listener AL_GAIN exceed 1.0 (amplification beyond the guaranteed dynamic range), distance and other attenuation might ultimately limit the overall AL_GAIN to a value below 1.0.
AL currently supports three modes of operation with respect to distance attenuation. It supports two distance-dependent attenuation models, one which is similar to the IASIG I3DL2 (and DS3D) model. The application choses one of these two models (or can chose to disable distance-dependent attenuation effects model) on a per-context basis.
Legal arguments are AL_NONE, AL_INVERSE_DISTANCE, and
AL_INVERSE_DISTANCE_CLAMPED.
AL_NONE bypasses all distance attenuation
calculation for all Sources. The implementation is expected to optimize this
situation.
AL_INVERSE_DISTANCE_CLAMPED is the DS3D model, with
AL_REFERENCE_DISTANCE indicating both the reference distance and the distance
below which gain will be clamped.
AL_INVERSE_DISTANCE is equivalent to the DS3D
model with the exception that AL_REFERENCE_DISTANCE does not imply any
clamping.
The AL implementation is still free to apply any range clamping as
necessary. The current distance model chosen can be queried using GetIntegerv and
AL_DISTANCE_MODEL.
value
- distance model to be setpublic static void alDopplerFactor(float value)
VD: AL_DOPPLER_VELOCITY DF: AL_DOPPLER_FACTOR vl: Listener velocity (scalar, projected on source-listener vector) vs: Source verlocity (scalar, projected on source-listener vector) f: Frequency in sample f': effective Doppler shifted frequencyf' = DF * f * (VD-vl)/(VD+vs)
vl<0, vs>0 : source and listener approaching each other vl>0, vs<0 : source and listener moving away from each other
The implementation has to clamp the projected Listener velocity vl, if abs(vl) is greater or equal VD. It similarly has to clamp the projected Source velocity vs if abs(vs) is greater or equal VD.
There are two API calls global to the current context that provide control of the two related parameters.
AL_DOPPLER_FACTOR is a simple scaling to exaggerate or deemphasize the Doppler (pitch) shift resulting from the calculation.
A negative value will result in an AL_INVALID_VALUE error, the command is then ignored. The default value is 1. The current setting can be queried using GetFloatv and AL_DOPPLER_FACTOR. The implementation is free to optimize the case of AL_DOPPLER_FACTOR being set to zero, as this effectively disables the effect.
value
- Doppler scale value to setpublic static void alDopplerVelocity(float value)
VD: AL_DOPPLER_VELOCITY DF: AL_DOPPLER_FACTOR vl: Listener velocity (scalar, projected on source-listener vector) vs: Source verlocity (scalar, projected on source-listener vector) f: Frequency in sample f': effective Doppler shifted frequencyf' = DF * f * (VD-vl)/(VD+vs)
vl<0, vs>0 : source and listener approaching each other vl>0, vs<0 : source and listener moving away from each other
The implementation has to clamp the projected Listener velocity vl, if abs(vl) is greater or equal VD. It similarly has to clamp the projected Source velocity vs if abs(vs) is greater or equal VD.
There are two API calls global to the current context that provide control of the two related parameters.
AL_DOPPLER_VELOCITY allows the application to change the reference (propagation) velocity used in the Doppler Effect calculation. This permits the application to use a velocity scale appropriate to its purposes.
A negative or zero value will result in an AL_INVALID_VALUE error, the command is then ignored. The default value is 1. The current setting can be queried using GetFloatv and AL_DOPPLER_VELOCITY.
value
- Doppler velocity value to setCopyright © 2002-2009 lwjgl.org. All Rights Reserved.