Main class for handling HaxeAL Soft operations such as playback.

Static variables

@:value(0x2002)staticfinalinlineread onlyBITS:Int = 0x2002

@:value(0x1009)staticfinalinlineread onlyBUFFER:Int = 0x1009

@:value(0x1016)staticfinalinlineread onlyBUFFERS_PROCESSED:Int = 0x1016

@:value(0x1015)staticfinalinlineread onlyBUFFERS_QUEUED:Int = 0x1015

@:value(0x1026)staticfinalinlineread onlyBYTE_OFFSET:Int = 0x1026

@:value(0x2003)staticfinalinlineread onlyCHANNELS:Int = 0x2003

@:value(0x1001)staticfinalinlineread onlyCONE_INNER_ANGLE:Int = 0x1001

@:value(0x1002)staticfinalinlineread onlyCONE_OUTER_ANGLE:Int = 0x1002

@:value(0x1022)staticfinalinlineread onlyCONE_OUTER_GAIN:Int = 0x1022

@:value(0x1005)staticfinalinlineread onlyDIRECTION:Int = 0x1005

@:value(0xD000)staticfinalinlineread onlyDISTANCE_MODEL:Int = 0xD000

@:value(0xC000)staticfinalinlineread onlyDOPPLER_FACTOR:Int = 0xC000

@:value(0xC001)staticfinalinlineread onlyDOPPLER_VELOCITY:Int = 0xC001

@:value(0xD005)staticfinalinlineread onlyEXPONENT_DISTANCE:Int = 0xD005

@:value(0xD006)staticfinalinlineread onlyEXPONENT_DISTANCE_CLAMPED:Int = 0xD006

@:value(0xB004)staticfinalinlineread onlyEXTENSIONS:Int = 0xB004

@:value(0)staticfinalinlineread onlyFALSE:Int = 0

@:value(0x1101)staticfinalinlineread onlyFORMAT_MONO16:Int = 0x1101

@:value(0x1100)staticfinalinlineread onlyFORMAT_MONO8:Int = 0x1100

@:value(0x1103)staticfinalinlineread onlyFORMAT_STEREO16:Int = 0x1103

@:value(0x1102)staticfinalinlineread onlyFORMAT_STEREO8:Int = 0x1102

@:value(0x2001)staticfinalinlineread onlyFREQUENCY:Int = 0x2001

@:value(0x100A)staticfinalinlineread onlyGAIN:Int = 0x100A

@:value(0x1011)staticfinalinlineread onlyINITIAL:Int = 0x1011

@:value(0xD001)staticfinalinlineread onlyINVERSE_DISTANCE:Int = 0xD001

@:value(0xD002)staticfinalinlineread onlyINVERSE_DISTANCE_CLAMPED:Int = 0xD002

@:value(0xD003)staticfinalinlineread onlyLINEAR_DISTANCE:Int = 0xD003

@:value(0xD004)staticfinalinlineread onlyLINEAR_DISTANCE_CLAMPED:Int = 0xD004

@:value(0x1007)staticfinalinlineread onlyLOOPING:Int = 0x1007

@:value(0x1023)staticfinalinlineread onlyMAX_DISTANCE:Int = 0x1023

@:value(0x100E)staticfinalinlineread onlyMAX_GAIN:Int = 0x100E

@:value(0x100D)staticfinalinlineread onlyMIN_GAIN:Int = 0x100D

@:value(0)staticfinalinlineread onlyNONE:Int = 0

@:value(0x100F)staticfinalinlineread onlyORIENTATION:Int = 0x100F

@:value(0x1013)staticfinalinlineread onlyPAUSED:Int = 0x1013

@:value(0x2011)staticfinalinlineread onlyPENDING:Int = 0x2011

@:value(0x1003)staticfinalinlineread onlyPITCH:Int = 0x1003

@:value(0x1012)staticfinalinlineread onlyPLAYING:Int = 0x1012

@:value(0x1004)staticfinalinlineread onlyPOSITION:Int = 0x1004

@:value(0x2012)staticfinalinlineread onlyPROCESSED:Int = 0x2012

@:value(0x1020)staticfinalinlineread onlyREFERENCE_DISTANCE:Int = 0x1020

@:value(0xB003)staticfinalinlineread onlyRENDERER:Int = 0xB003

@:value(0x1021)staticfinalinlineread onlyROLLOFF_FACTOR:Int = 0x1021

@:value(0x1025)staticfinalinlineread onlySAMPLE_OFFSET:Int = 0x1025

@:value(0x1024)staticfinalinlineread onlySEC_OFFSET:Int = 0x1024

@:value(0x2004)staticfinalinlineread onlySIZE:Int = 0x2004

@:value(0x202)staticfinalinlineread onlySOURCE_RELATIVE:Int = 0x202

@:value(0x1010)staticfinalinlineread onlySOURCE_STATE:Int = 0x1010

@:value(0x1027)staticfinalinlineread onlySOURCE_TYPE:Int = 0x1027

@:value(0xC003)staticfinalinlineread onlySPEED_OF_SOUND:Int = 0xC003

@:value(0x1028)staticfinalinlineread onlySTATIC:Int = 0x1028

@:value(0x1014)staticfinalinlineread onlySTOPPED:Int = 0x1014

@:value(0x1029)staticfinalinlineread onlySTREAMING:Int = 0x1029

@:value(1)staticfinalinlineread onlyTRUE:Int = 1

@:value(0x1030)staticfinalinlineread onlyUNDETERMINED:Int = 0x1030

@:value(0x2010)staticfinalinlineread onlyUNUSED:Int = 0x2010

@:value(0x1006)staticfinalinlineread onlyVELOCITY:Int = 0x1006

@:value(0xB001)staticfinalinlineread onlyVENDOR:Int = 0xB001

@:value(0xB002)staticfinalinlineread onlyVERSION:Int = 0xB002

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 data.length.

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 data points to. If your format is stereo (2 channel), you should multiply the sample value by 2. If your format is 16 bit, you should multiply the value by 2 again. These multiplications stack, meaning with a STEREO16 format your size should be samples * 2 * 2.

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).

staticcreateBuffer():ALBuffer

Creates a buffer and returns it.

staticcreateBuffers(num:Int):Array<ALBuffer>

Returns an array of ALBuffers.

Parameters:

num

Amount of buffers to return.

staticcreateSource():ALSource

Creates a source and returns it.

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.

@:has_untypedstaticgetBuffer3f(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.

@:has_untypedstaticgetBuffer3i(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 getError

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 getError

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.

@:has_untypedstaticgetListener3f(param:Int):Array<Float>

Returns an array of three float values from the given param.

Parameters:

param

Param to get value of.

@:has_untypedstaticgetListener3i(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.

@:has_untypedstaticgetProcAddress(funcName:String):Dynamic

Deprecated:

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.

@:has_untypedstaticgetSource3f(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.

@:has_untypedstaticgetSource3i(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.