Class for handling the HaxeAL Context.

Static variables

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

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

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

@:value(0x311)staticfinalinlineread onlyCAPTURE_DEFAULT_DEVICE_SPECIFIER:Int = 0x311

@:value(0x310)staticfinalinlineread onlyCAPTURE_DEVICE_SPECIFIER:Int = 0x310

@:value(0x312)staticfinalinlineread onlyCAPTURE_SAMPLES:Int = 0x312

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

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

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

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

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

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

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

@:value(0x1000)staticfinalinlineread onlyMAJOR_VERSION:Int = 0x1000

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

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

@:value(0x1008)staticfinalinlineread onlyREFRESH:Int = 0x1008

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

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

Static methods

@:has_untyped@:value({ byteLength : 1 })staticcaptureSamples(device:ALCaptureDevice, samples:Int, byteLength:Int = 1):Star<Void>

Collects captured data from a devices' capture buffer and returns it as a raw cpp pointer (use HaxeAL.bufferData_PCM with this data).

The underlying type of the raw cpp pointer is dependant on the devices' captureFormat (UInt8 if MONO8 or STEREO8, otherwise Int16)

Parameters:

device

Device to retrieve audio from.

samples

The amount of samples to retrieve. This amount should not be higher than getIntegers(device, ALC_CAPTURE_SAMPLES, 1). The amount of time that a block of samples represents is relatives to the input devices' capturing frequency (22050 samples to retrieve at 44100hz would be 0.5 seconds)

byteLength

By default this value is 1 (FORMAT_MONO8). If your format is stereo (2 channel), you should multiply this 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 byteLength should be 4.

staticcloseCaptureDevice(device:ALCaptureDevice):Bool

Closes the given audio recording device and returns whether the operation was successful/valid or not.

Parameters:

device

Device you want to close.

staticcloseDevice(device:ALDevice):Bool

Closes the given device and returns whether the operation was successful/valid or not.

Parameters:

device

Device you want to close.

staticcreateContext(device:ALDevice, ?attributes:Array<Int>):ALContext

Creates a context on the given device with the given attributes and returns it.

Parameters:

device

Device to create context on.

attributes

Attributes to set for the context (format: [ATTRIBUTE_PARAM, VALUE, ATTRIBUTE_PARAM2, VALUE2...])

staticdestroyContext(context:ALContext):Void

Destroys the given context.

Parameters:

context

Context to destroy.

staticgetCurrentContext():ALContext

Returns the current OpenAL context.

staticgetDeviceFromContext(context:ALContext):ALDevice

Gets the device related to the given context and returns it.

Parameters:

context

The context to get the device from.

staticgetEnumValue(?device:Null<ALDevice>, enumName:String):Int

Retrieves an AL enum value (Integer) from the given name. @param enumName The enum value to get.

Parameters:

device

Enum related device, can be left as null if the enum isnt device specific. *

staticgetError(?device:Null<ALDevice>):Int

Returns a device-specific error code, if there is any error.

Parameters:

device

Device to check on for errors.

staticgetIntegers(device:ALDevice, param:Int, argumentCount:Int):Array<Int>

Returns integers related to the given parameter of the current context for the device (or none if its not device specific).

Parameters:

device

Device for device specific integer values

param

Parameter to get values of

argumentCount

Amount of array objects you expect to return

staticgetString(?device:Null<ALDevice>, param:Int):String

Gets the string value of the given parameter and returns it.

If device isnt null, a device parameter can be obtained.

Parameters:

device

The device to receive the parameter of, if the parameter is tied to a device. Leave null otherwise.

param

Parameter to get

staticisExtensionPresent(?device:Null<ALDevice>, extName:String):Bool

Returns true if an extension by the given name is available on the given device.

Parameters:

device

Extension related device, can be left as null if the extension isnt device specific.

extName

Name of the extension to check for.

staticmakeContextCurrent(context:ALContext):Bool

Sets the given context as the current OpenAL context.

Returns whether this operation was successful or not.

Parameters:

context

Context to set as "current".

@:value({ bufferSize : 22050, captureFormat : HaxeAL.FORMAT_MONO16, captureFrequency : 44100 })staticopenCaptureDevice(deviceName:ConstCharStar, captureFrequency:Int = 44100, captureFormat:Int = HaxeAL.FORMAT_MONO16, bufferSize:Int = 22050):ALCaptureDevice

Opens a device dedicated to audio recording by name with the given recording properties and returns it.

Parameters:

deviceName

Name of the recording device you want to open (default device name can be gotten using getString with argument CAPTURE_DEFAULT_DEVICE_SPECIFIER).

captureFrequency

The frequency at which to capture audio, standard is 44100.

captureFormat

The format at which to capture audio, standard is 16 bit mono.

bufferSize

The size of the recording buffer, in which recorded data will be stored (until retrieved via captureSamples). The default is 22050, half of the standard frequency, so in this case half a second.

staticopenDevice(deviceName:String):ALDevice

Opens a device by name and returns the created device.

Parameters:

deviceName

Name of the device you want to open (default device name can be gotten using getString)

staticprocessContext(context:ALContext):Void

Tells the given context to begin processing.

Parameters:

context

Context to start processing on.

staticstartCapture(device:ALCaptureDevice):Void

Starts capturing audio samples on the given device.

Parameters:

device

Device to start capturing on.

staticstopCapture(device:ALCaptureDevice):Void

Stops capturing audio samples on the given device.

Parameters:

device

Device to stop capturing on.

staticsuspendContext(context:ALContext):Void

Suspends processing on the given context.

Parameters:

context

Context to suspend processing on.