Class for handling the HaxeAL Context.
Static variables
Static methods
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 |
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 |
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. |
---|
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". |
---|
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 |
---|---|
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 |
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 |
---|
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. |
---|