Main class for handling HaxeAL Soft operations such as playback.
Static variables
Static methods
staticbuffer3f(buffer:ALBuffer, param:Int, value1:Float, value2:Float, value3:Float):Void
Sets three float values for the target parameter of the given buffer.
Parameters:
buffer | Buffer to change parameter of. |
---|---|
param | Param to set values of. |
value1 | First new float value of the param. |
value2 | Second new float value of the param. |
value3 | Third new float value of the param. |
staticbuffer3i(buffer:ALBuffer, param:Int, value1:Int, value2:Int, value3:Int):Void
Sets three integer values for the target parameter of the given buffer.
Parameters:
buffer | Buffer to change parameter of. |
---|---|
param | Param to set values of. |
value1 | First new integer value of the param. |
value2 | Second new integer value of the param. |
value3 | Third new integer value of the param. |
staticbufferData(buffer:ALBuffer, format:Int, data:Bytes, size:Int, sampleRate:Int):Void
Fills the given buffer with all information necessary for playback.
Parameters:
buffer | The ALBuffer to fill with information. |
---|---|
format | The AL format the data should be stored under (Ex: HaxeAL.FORMAT_STEREO16). |
data | The data to be fed as bytes. |
size | Size of the data to be fed, here this should be |
sampleRate | The samplerate the data should be played back at. |
staticbufferData_PCM(buffer:ALBuffer, format:Int, data:Star<Void>, size:Int, sampleRate:Int):Void
Fills the given buffer with all information necessary for playback, used to handle raw PCM data.
Parameters:
buffer | The ALBuffer to fill with information. |
---|---|
format | The AL format the data should be stored under (Ex: HaxeAL.FORMAT_MONO16). |
data | The data to be fed as raw pcm data in the form a raw cpp Void pointer. |
size | Size of the data to be fed.
By default this is simply the amount of samples the |
sampleRate | The samplerate the data should be played back at. |
staticbufferf(buffer:ALBuffer, param:Int, value:Float):Void
Sets the float value for the target parameter of the given buffer.
Parameters:
buffer | Buffer to change parameter of. |
---|---|
param | Param to set value of. |
value | New float value of the param. |
staticbufferfv(buffer:ALBuffer, param:Int, values:Array<Float>):Void
Sets an array of float values for the target parameter of the given buffer.
Parameters:
buffer | Buffer to change parameter of. |
---|---|
param | Param to set values of. |
value | New float values of the param as an array (array length should be the same as amount of values the parameter takes). |
staticbufferi(buffer:ALBuffer, param:Int, value:Int):Void
Sets the integer value for the target parameter of the given buffer.
Parameters:
buffer | Buffer to change parameter of. |
---|---|
param | Param to set value of. |
value | New integer value of the param. |
staticbufferiv(buffer:ALBuffer, param:Int, values:Array<Int>):Void
Sets an array of integer values for the target parameter of the given buffer.
Parameters:
buffer | Buffer to change parameter of. |
---|---|
param | Param to set values of. |
value | New integer values of the param as an array (array length should be the same as amount of values the parameter takes). |
staticcreateBuffers(num:Int):Array<ALBuffer>
Returns an array of ALBuffers.
Parameters:
num | Amount of buffers to return. |
---|
staticcreateSources(num:Int):Array<ALSource>
Returns an array of ALSources.
Parameters:
num | Amount of sources to return. |
---|
staticdeleteBuffer(buffer:ALBuffer):Void
Deletes a singular ALBuffer
Parameters:
buffer | Buffer to delete. |
---|
staticdeleteBuffers(buffers:Array<ALBuffer>):Void
Deletes an array of ALBuffers.
Parameters:
buffers | Buffers to delete. |
---|
staticdeleteSource(source:ALSource):Void
Deletes a singular ALSource
Parameters:
source | Source to delete. |
---|
staticdeleteSources(sources:Array<ALSource>):Void
Deletes an array of ALSources.
Parameters:
sources | Sources to delete. |
---|
staticdisable(capability:Int):Void
Disables the given capability.
Parameters:
capability | Capability to disable. |
---|
staticdistanceModel(distanceModel:DistanceModel):Void
Sets AL's distance attenuation model.
Range: [NONE, INVERSE_DISTANCE, INVERSE_DISTANCE_CLAMPED,
LINEAR_DISTANCE, LINEAR_DISTANCE_CLAMPED,
EXPONENT_DISTANCE, EXPONENT_DISTANCE_CLAMPED]
Default: INVERSE_DISTANCE_CLAMPED
The model by which sources attenuate with distance.
None - No distance attenuation.
Inverse - Doubling the distance halves the source gain.
Linear - Linear gain scaling between the reference and max distances.
Exponent - Exponential gain dropoff.
Clamped variations work like the non-clamped counterparts, except the distance calculated is clamped between the reference and max distances.
staticdopplerFactor(value:Single):Void
Sets the value for AL's doppler factor.
Range: [0.0 - POSITIVE_INFINITY]
Default: 1.0
Parameters:
value | The value to set the doppler factor to. |
---|
staticdopplerVelocity(value:Single):Void
Sets the value for AL's (deprecated) doppler velocity.
Acts as a multiplier applied to the Speed of Sound.
Parameters:
value | The value to set the doppler velocity to. |
---|
staticenable(capability:Int):Void
Enables the given capability.
Parameters:
capability | Capability to enable. |
---|
staticgetBoolean(param:Int):Bool
Returns a boolean value from the given AL parameter.
Parameters:
param | Parameter to get value of. |
---|
staticgetBuffer3f(buffer:ALBuffer, param:Int):Array<Float>
Returns an array of three float values for the target parameter of the given buffer.
Parameters:
buffer | Buffer to get parameter of. |
---|---|
param | Param to get values of. |
staticgetBuffer3i(buffer:ALBuffer, param:Int):Array<Int>
Returns an array of three integer values for the target parameter of the given buffer.
Parameters:
buffer | Buffer to get parameter of. |
---|---|
param | Param to get values of. |
staticgetBufferf(buffer:ALBuffer, param:Int):Float
Gets the float value for the target parameter of the given buffer.
Parameters:
buffer | Buffer to get parameter of. |
---|---|
param | Param to get value of. |
staticgetBufferfv(buffer:ALBuffer, param:Int):Array<Float>
Returns an array of multiple float values for the target parameter of the given buffer.
The array size depends on the given param.
Parameters:
buffer | Buffer to get parameter of. |
---|---|
param | Param to get values of. |
staticgetBufferi(buffer:ALBuffer, param:Int):Int
Gets the integer value for the target parameter of the given buffer.
Parameters:
buffer | Buffer to get parameter of. |
---|---|
param | Param to get value of. |
staticgetBufferiv(buffer:ALBuffer, param:Int):Array<Int>
Returns an array of multiple integer values for the target parameter of the given buffer.
The array size depends on the given param.
Parameters:
buffer | Buffer to get parameter of. |
---|---|
param | Param to get values of. |
staticgetDouble(param:Int):Float
Returns a double precision floating point value from the given AL parameter.
Parameters:
param | Parameter to get value of. |
---|
staticgetEnumValue(enumName:String):Int
Retrieves an AL enum value (Integer) from the given name.
Parameters:
enumName | The enum value to get. |
---|
staticgetError():Int
Checks for any OpenAL errors and returns the ID of the error code.
The definition can be logged to the console using getErrorString
or obtained as a variable using getErrorDefinition
.
staticinlinegetErrorDefinition(error:Int):ALErrorDef
Gets the definition of an error code and returns it.
Parameters:
error | Error code obtained through |
---|
staticinlinegetErrorString(error:Int):Void
Logs the definition of an error code to the console.
The created log is only a more tidy version of tracing getErrorDefinition
.
Parameters:
error | Error code obtained through |
---|
staticgetFloat(param:Int):Single
Returns a single precision floating point value from the given AL parameter. (Can be used as a regular Float aswell)
Parameters:
param | Parameter to get value of. |
---|
staticgetInteger(param:Int):Int
Returns an integer value from the given AL parameter.
Parameters:
param | Parameter to get value of. |
---|
staticgetListener3f(param:Int):Array<Float>
Returns an array of three float values from the given param.
Parameters:
param | Param to get value of. |
---|
staticgetListener3i(param:Int):Array<Int>
Returns an array of three integer values from the given param.
Parameters:
param | Param to get value of. |
---|
staticgetListenerf(param:Int):Float
Returns the current float value of the given param.
Parameters:
param | Param to get value of. |
---|
staticgetListenerfv(param:Int):Array<Float>
Returns an array of multiple float values from the given param.
The array size depends on the given param.
Parameters:
param | Param to get values of. |
---|
staticgetListeneri(param:Int):Int
Returns the current integer value of the given param.
Parameters:
param | Param to get value of. |
---|
staticgetListeneriv(param:Int):Array<Int>
Returns an array of multiple integer values from the given param.
The array size depends on the given param.
Parameters:
param | Param to get values of. |
---|
staticgetProcAddress(funcName:String):Dynamic
Advanced usage function, gets the pointer to a function by name and returns it.
The returned function address can be casted to a defined function.
The defined function then acts as a caller for the pointed to function.
This function hasn't been tested and might not work as expected.
Parameters:
funcName | Name of the function you want to get. The function might be context specific. |
---|
staticgetSource3f(source:ALSource, param:Int):Array<Float>
Returns an array of three float values for the target parameter of the given source.
Parameters:
source | Source to get parameter of. |
---|---|
param | Param to get values of. |
staticgetSource3i(source:ALSource, param:Int):Array<Int>
Returns an array of three integer values for the target parameter of the given source.
Parameters:
source | Source to get parameter of. |
---|---|
param | Param to get values of. |
staticgetSourcef(source:ALSource, param:Int):Float
Gets the float value for the target parameter of the given source.
Parameters:
source | Source to get parameter of. |
---|---|
param | Param to get value of. |
staticgetSourcefv(source:ALSource, param:Int):Array<Float>
Returns an array of multiple float values for the target parameter of the given source.
The array size depends on the given param.
Parameters:
source | Source to get parameter of. |
---|---|
param | Param to get values of. |
staticgetSourcei(source:ALSource, param:Int):Int
Gets the integer value for the target parameter of the given source.
Parameters:
source | Source to get parameter of. |
---|---|
param | Param to get value of. |
staticgetSourceiv(source:ALSource, param:Int):Array<Int>
Returns an array of multiple integer values for the target parameter of the given source.
The array size depends on the given param.
Parameters:
source | Source to get parameter of. |
---|---|
param | Param to get values of. |
staticgetString(param:Int):String
Returns a string value from the given AL parameter.
Parameters:
param | Parameter to get value of. |
---|
staticisBuffer(buffer:ALBuffer):Bool
Checks if the given buffer is a valid ALBuffer object.
Parameters:
buffer | Buffer to check validity of. |
---|
staticisEnabled(capability:Int):Bool
Checks if the given capability is enabled and returns true
if so.
Parameters:
capability | Capability to check. |
---|
staticisExtensionPresent(extName:String):Bool
Returns true if an extension by the given name is available on this context.
Parameters:
extName | Name of the extension to check for. |
---|
staticisSource(source:ALSource):Bool
Checks if the given source is a valid ALSource object.
Parameters:
source | Source to check validity of. |
---|
staticlistener3f(param:Int, value1:Float, value2:Float, value3:Float):Void
Sets three float values for the given parameter of the current listener object.
Parameters:
param | Parameter to set values of. |
---|---|
value1 | First float value for the parameter. |
value2 | Second float value for the parameter. |
value3 | Third float value for the parameter. |
staticlistener3i(param:Int, value1:Int, value2:Int, value3:Int):Void
Sets three integer values for the given parameter of the current listener object.
Parameters:
param | Parameter to set values of. |
---|---|
value1 | First integer value for the parameter. |
value2 | Second integer value for the parameter. |
value3 | Third integer value for the parameter. |
staticlistenerf(param:Int, value:Float):Void
Sets a float value for the given parameter of the current listener object.
Parameters:
param | Parameter to set value of. |
---|---|
value | New float value for the parameter. |
staticlistenerfv(param:Int, values:Array<Float>):Void
Sets an array of float values for the given parameter of the current listener object.
Parameters:
param | Parameter to set values of. |
---|---|
values | New float values for the parameter as an array (array length should be the same as amount of values the parameter takes). |
staticlisteneri(param:Int, value:Int):Void
Sets an integer value for the given parameter of the current listener object.
Parameters:
param | Parameter to set value of. |
---|---|
value | New integer value for the parameter. |
staticlisteneriv(param:Int, values:Array<Int>):Void
Sets an array of integer values for the given parameter of the current listener object.
Parameters:
param | Parameter to set values of. |
---|---|
values | New integer values for the parameter as an array (array length should be the same as amount of values the parameter takes). |
staticsource3f(source:ALSource, param:Int, value1:Float, value2:Float, value3:Float):Void
Sets three float values for the target parameter of the given source.
Parameters:
source | Source to change parameter of. |
---|---|
param | Param to set values of. |
value1 | First new float value of the param. |
value2 | Second new float value of the param. |
value3 | Third new float value of the param. |
staticsource3i(source:ALSource, param:Int, value1:Int, value2:Int, value3:Int):Void
Sets three integer values for the target parameter of the given source.
Parameters:
source | Source to change parameter of. |
---|---|
param | Param to set values of. |
value1 | First new integer value of the param. |
value2 | Second new integer value of the param. |
value3 | Third new integer value of the param. |
staticsourcePause(source:ALSource):Void
Pauses audio-playback for the source, keeping the sound position unchanged.
Parameters:
source | Source to pause playback of. |
---|
staticsourcePausev(sources:Array<ALSource>):Void
Pauses audio-playback for the sources, keeping their sound position unchanged.
Parameters:
sources | Sources to pause playback of. |
---|
staticsourcePlay(source:ALSource):Void
Plays back audio from the sources buffer.
Parameters:
source | Source to play audio from. |
---|
staticsourcePlayv(sources:Array<ALSource>):Void
Plays back audio from the sources' buffers.
Parameters:
sources | Sources to play audio from. |
---|
staticsourceQueueBuffers(source:ALSource, buffers:Array<ALBuffer>):Void
Queues the buffers' data to be played chronologically once the data for the current buffer has finished playing back on the source.
Parameters:
source | Source to queue buffers for. |
---|---|
buffers | Buffers to be played back chronologically. |
staticsourceRewind(source:ALSource):Void
Stops audio-playback for the source and sets its state to HaxeAL.INITIAL
.
Parameters:
source | Source to be rewound. |
---|
staticsourceRewindv(sources:Array<ALSource>):Void
Stops audio-playback for the sources and sets their state to HaxeAL.INITIAL
.
Parameters:
sources | Sources to be rewound. |
---|
staticsourceStop(source:ALSource):Void
Completely stops audio-playback for the source and sets the sound position back to 0.
Parameters:
source | Source to stop playback of. |
---|
staticsourceStopv(sources:Array<ALSource>):Void
Completely stops audio-playback for the sources and sets their sound position back to 0.
Parameters:
sources | Sources to stop playback of. |
---|
staticsourceUnqueueBuffers(source:ALSource, numBuffers:Int):Array<ALBuffer>
Unqueues the given number of processed buffers and returns the now available (unqueued) buffers.
If numBuffers is larger than the amount of processed buffers (the ones already played back) on the source
(aquired using getSourcei
with BUFFERS_PROCESSED
) the operation will fail!
Parameters:
source | Source to unqueue buffers of. |
---|---|
numBuffers | The amount of buffers to unqueue. |
staticsourcef(source:ALSource, param:Int, value:Float):Void
Sets the float value for the target parameter of the given source.
Parameters:
source | Source to change parameter of. |
---|---|
param | Param to set value of. |
value | New float value of the param. |
staticsourcefv(source:ALSource, param:Int, values:Array<Float>):Void
Sets an array of float values for the target parameter of the given source.
Parameters:
source | Source to change parameter of. |
---|---|
param | Param to set values of. |
value | New float values of the param as an array (array length should be the same as amount of values the parameter takes). |
staticsourcei(source:ALSource, param:Int, value:Null<Int>):Void
Sets the integer value for the target parameter of the given source.
Parameters:
source | Source to change parameter of. |
---|---|
param | Param to set value of. |
value | New integer value of the param. |
staticsourceiv(source:ALSource, param:Int, values:Array<Int>):Void
Sets an array of integer values for the target parameter of the given source.
Parameters:
source | Source to change parameter of. |
---|---|
param | Param to set values of. |
value | New integer values of the param as an array (array length should be the same as amount of values the parameter takes). |
staticspeedOfSound(value:Single):Void
Sets AL's speed of sound value, in units per second.
Range: [0.0001 - POSITIVE_INFINITY]
Default: 343.3
Parameters:
value | The value to set the speed of sound to. |
---|