Show / Hide Table of Contents

Class AL

Provides access to the OpenAL 1.1 flat API.

Inheritance
object
ALBase
AL
Inherited Members
ALBase.RegisterOpenALResolver()
ALBase.LoadDelegate<TDelegate>(string)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenTK.Audio.OpenAL
Assembly: OpenTK.Audio.OpenAL.dll
Syntax
public class AL : ALBase

Methods

BufferData(int, ALFormat, ref byte, int, int)

This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well.

Declaration
public static extern void BufferData(int bid, ALFormat format, ref byte buffer, int size, int freq)
Parameters
Type Name Description
int bid

buffer Handle/Name to be filled with buffer.

ALFormat format

Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.

byte buffer

Pointer to a pinned audio buffer.

int size

The size of the audio buffer in bytes.

int freq

The frequency of the audio buffer.

BufferData(int, ALFormat, ref short, int, int)

This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well.

Declaration
public static extern void BufferData(int bid, ALFormat format, ref short buffer, int bytes, int freq)
Parameters
Type Name Description
int bid

buffer Handle/Name to be filled with buffer.

ALFormat format

Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.

short buffer

Pointer to a pinned audio buffer.

int bytes

The size of the audio buffer in bytes.

int freq

The frequency of the audio buffer.

BufferData(int, ALFormat, IntPtr, int, int)

This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well.

Declaration
public static extern void BufferData(int bid, ALFormat format, IntPtr buffer, int size, int freq)
Parameters
Type Name Description
int bid

buffer Handle/Name to be filled with buffer.

ALFormat format

Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.

IntPtr buffer

Pointer to a pinned audio buffer.

int size

The size of the audio buffer in bytes.

int freq

The frequency of the audio buffer.

BufferData(int, ALFormat, void*, int, int)

This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well.

Declaration
public static extern void BufferData(int bid, ALFormat format, void* buffer, int size, int freq)
Parameters
Type Name Description
int bid

buffer Handle/Name to be filled with buffer.

ALFormat format

Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.

void* buffer

Pointer to a pinned audio buffer.

int size

The size of the audio buffer in bytes.

int freq

The frequency of the audio buffer.

BufferData<TBuffer>(int, ALFormat, TBuffer[], int)

This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well.

Declaration
public static void BufferData<TBuffer>(int bid, ALFormat format, TBuffer[] buffer, int freq) where TBuffer : unmanaged
Parameters
Type Name Description
int bid

buffer Handle/Name to be filled with buffer.

ALFormat format

Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.

TBuffer[] buffer

The audio buffer.

int freq

The frequency of the audio buffer.

Type Parameters
Name Description
TBuffer

The type of the data buffer.

BufferData<TBuffer>(int, ALFormat, ReadOnlySpan<TBuffer>, int)

This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well.

Declaration
public static void BufferData<TBuffer>(int bid, ALFormat format, ReadOnlySpan<TBuffer> buffer, int freq) where TBuffer : unmanaged
Parameters
Type Name Description
int bid

buffer Handle/Name to be filled with buffer.

ALFormat format

Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.

ReadOnlySpan<TBuffer> buffer

Span representing the audio buffer.

int freq

The frequency of the audio buffer.

Type Parameters
Name Description
TBuffer

The type of the buffer elements.

DeleteBuffer(int)

This function deletes one buffer only, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.

Declaration
public static void DeleteBuffer(int buffer)
Parameters
Type Name Description
int buffer

Pointer to a buffer name identifying the buffer to be deleted.

DeleteBuffers(int, int[])

This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.

Declaration
public static extern void DeleteBuffers(int n, int[] buffers)
Parameters
Type Name Description
int n

The number of buffers to be deleted.

int[] buffers

Pointer to an array of buffer names identifying the buffers to be deleted.

DeleteBuffers(int, ref int)

This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.

Declaration
public static extern void DeleteBuffers(int n, ref int buffers)
Parameters
Type Name Description
int n

The number of buffers to be deleted.

int buffers

Pointer to an array of buffer names identifying the buffers to be deleted.

DeleteBuffers(int, int*)

This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.

Declaration
public static extern void DeleteBuffers(int n, int* buffers)
Parameters
Type Name Description
int n

The number of buffers to be deleted.

int* buffers

Pointer to an array of buffer names identifying the buffers to be deleted.

DeleteBuffers(int[])

This function deletes an array of buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.

Declaration
public static void DeleteBuffers(int[] buffers)
Parameters
Type Name Description
int[] buffers

An array of buffer names to delete.

DeleteBuffers(ReadOnlySpan<int>)

This function deletes a span of buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.

Declaration
public static void DeleteBuffers(ReadOnlySpan<int> buffers)
Parameters
Type Name Description
ReadOnlySpan<int> buffers

Span of buffer names to delete.

DeleteSource(int)

This function deletes one source only.

Declaration
public static void DeleteSource(int source)
Parameters
Type Name Description
int source

Pointer to a source name identifying the source to be deleted.

DeleteSources(int, ref int)

This function deletes one or more sources.

Declaration
public static extern void DeleteSources(int n, ref int sources)
Parameters
Type Name Description
int n

The number of sources to be deleted.

int sources

Reference to a single source, or an array of source names identifying the sources to be deleted.

DeleteSources(int, int*)

This function deletes one or more sources.

Declaration
public static extern void DeleteSources(int n, int* sources)
Parameters
Type Name Description
int n

The number of sources to be deleted.

int* sources

Pointer to an array of source names identifying the sources to be deleted.

DeleteSources(int[])

This function deletes one or more sources.

Declaration
public static void DeleteSources(int[] sources)
Parameters
Type Name Description
int[] sources

An array of source names identifying the sources to be deleted.

DeleteSources(ReadOnlySpan<int>)

This function deletes one or more sources.

Declaration
public static void DeleteSources(ReadOnlySpan<int> sources)
Parameters
Type Name Description
ReadOnlySpan<int> sources

An array of source names identifying the sources to be deleted.

Disable(ALCapability)

This function disables a feature of the OpenAL driver.

Declaration
public static extern void Disable(ALCapability capability)
Parameters
Type Name Description
ALCapability capability

The name of a capability to disable.

DistanceModel(ALDistanceModel)

This function selects the OpenAL distance model – ALDistanceModel.InverseDistance, ALDistanceModel.InverseDistanceClamped, ALDistanceModel.LinearDistance, ALDistanceModel.LinearDistanceClamped, ALDistanceModel.ExponentDistance, ALDistanceModel.ExponentDistanceClamped, or ALDistanceModel.None. The default distance model in OpenAL is ALDistanceModel.InverseDistanceClamped.

Declaration
public static extern void DistanceModel(ALDistanceModel distancemodel)
Parameters
Type Name Description
ALDistanceModel distancemodel

The distance model to use.

Remarks

The ALDistanceModel .InverseDistance model works according to the following formula: gain = ALSourcef.ReferenceDistance / (ALSourcef.ReferenceDistance + ALSourcef.RolloffFactor * (distance – ALSourcef.ReferenceDistance));

The ALDistanceModel .InverseDistanceClamped model works according to the following formula: distance = max(distance,ALSourcef.ReferenceDistance); distance = min(distance,ALSourcef.MaxDistance); gain = ALSourcef.ReferenceDistance / (ALSourcef.ReferenceDistance + ALSourcef.RolloffFactor * (distance – ALSourcef.ReferenceDistance));

The ALDistanceModel.LinearDistance model works according to the following formula: distance = min(distance, ALSourcef.MaxDistance) // avoid negative gain gain = (1 – ALSourcef.RolloffFactor * (distance – ALSourcef.ReferenceDistance) / (ALSourcef.MaxDistance – ALSourcef.ReferenceDistance))

The ALDistanceModel.LinearDistanceClamped model works according to the following formula: distance = max(distance, ALSourcef.ReferenceDistance) distance = min(distance, ALSourcef.MaxDistance) gain = (1 – ALSourcef.RolloffFactor * (distance – ALSourcef.ReferenceDistance) / (ALSourcef.MaxDistance – ALSourcef.ReferenceDistance))

The ALDistanceModel.ExponentDistance model works according to the following formula: gain = (distance / ALSourcef.ReferenceDistance) ^ (- ALSourcef.RolloffFactor)

The ALDistanceModel.ExponentDistanceClamped model works according to the following formula: distance = max(distance, ALSourcef.ReferenceDistance) distance = min(distance, ALSourcef.MaxDistance) gain = (distance / ALSourcef.ReferenceDistance) ^ (- ALSourcef.RolloffFactor)

The ALDistanceModel.None model works according to the following formula:

gain = 1f;
.

DopplerFactor(float)

AL.DopplerFactor is a simple scaling of source and listener velocities to exaggerate or deemphasize the Doppler (pitch) shift resulting from the calculation.

Declaration
public static extern void DopplerFactor(float value)
Parameters
Type Name Description
float value

A negative value will result in an error, the command is then ignored. The default value is 1f. The current setting can be queried using AL.Get with parameter ALGetFloat.SpeedOfSound.

DopplerVelocity(float)

This function is deprecated and should not be used.

Declaration
public static extern void DopplerVelocity(float value)
Parameters
Type Name Description
float value

The default is 1.0f.

Enable(ALCapability)

This function enables a feature of the OpenAL driver. There are no capabilities defined in OpenAL 1.1 to be used with this function, but it may be used by an extension.

Declaration
public static extern void Enable(ALCapability capability)
Parameters
Type Name Description
ALCapability capability

The name of a capability to enable.

GenBuffer()

This function generates one buffer only, which contain audio data (see AL.BufferData). References to buffers are uint values, which are used wherever a buffer reference is needed (in calls such as AL.DeleteBuffers, AL.Source with parameter ALSourcei, AL.SourceQueueBuffers, and AL.SourceUnqueueBuffers).

Declaration
public static int GenBuffer()
Returns
Type Description
int

Pointer to an uint value which will store the name of the new buffer.

GenBuffer(out int)

This function generates one buffer only, which contain audio data (see AL.BufferData). References to buffers are uint values, which are used wherever a buffer reference is needed (in calls such as AL.DeleteBuffers, AL.Source with parameter ALSourcei, AL.SourceQueueBuffers, and AL.SourceUnqueueBuffers).

Declaration
public static void GenBuffer(out int buffer)
Parameters
Type Name Description
int buffer

Pointer to an uint value which will store the names of the new buffer.

GenBuffers(int, int[])

This function generates one or more buffers, which contain audio buffer (see AL.BufferData).

Declaration
public static extern void GenBuffers(int n, int[] buffers)
Parameters
Type Name Description
int n

The number of buffers to be generated.

int[] buffers

Pointer to an array of int values which will store the names of the new buffers.

GenBuffers(int, ref int)

This function generates one or more buffers, which contain audio buffer (see AL.BufferData).

Declaration
public static extern void GenBuffers(int n, ref int buffers)
Parameters
Type Name Description
int n

The number of buffers to be generated.

int buffers

Pointer to an array of int values which will store the names of the new buffers.

GenBuffers(int, int*)

This function generates one or more buffers, which contain audio buffer (see AL.BufferData). References to buffers are uint values, which are used wherever a buffer reference is needed (in calls such as AL.DeleteBuffers, AL.Source with parameter ALSourcei, AL.SourceQueueBuffers, and AL.SourceUnqueueBuffers).

Declaration
public static extern void GenBuffers(int n, int* buffers)
Parameters
Type Name Description
int n

The number of buffers to be generated.

int* buffers

Pointer to an array of uint values which will store the names of the new buffers.

GenBuffers(int)

This function generates one or more buffers, which contain audio data (see AL.BufferData). References to buffers are uint values, which are used wherever a buffer reference is needed (in calls such as AL.DeleteBuffers, AL.Source with parameter ALSourcei, AL.SourceQueueBuffers, and AL.SourceUnqueueBuffers).

Declaration
public static int[] GenBuffers(int n)
Parameters
Type Name Description
int n

The number of buffers to be generated.

Returns
Type Description
int[]

Pointer to an array of uint values which will store the names of the new buffers.

GenBuffers(Span<int>)

This function generates one or more buffers, which contain audio buffer (see AL.BufferData).

Declaration
public static void GenBuffers(Span<int> buffers)
Parameters
Type Name Description
Span<int> buffers

Span to fill with generated buffer names.

GenSource()

This function generates one source only.

Declaration
public static int GenSource()
Returns
Type Description
int

Pointer to an int value which will store the name of the new source.

GenSource(out int)

This function generates one source only.

Declaration
public static void GenSource(out int source)
Parameters
Type Name Description
int source

Pointer to an int value which will store the name of the new source.

GenSources(int, int[])

This function generates one or more sources.

Declaration
public static extern void GenSources(int n, int[] sources)
Parameters
Type Name Description
int n

The number of sources to be generated.

int[] sources

Pointer to an array of int values which will store the names of the new sources.

GenSources(int, ref int)

This function generates one or more sources.

Declaration
public static extern void GenSources(int n, ref int sources)
Parameters
Type Name Description
int n

The number of sources to be generated.

int sources

Pointer to an array of int values which will store the names of the new sources.

GenSources(int, int*)

This function generates one or more sources.

Declaration
public static extern void GenSources(int n, int* sources)
Parameters
Type Name Description
int n

The number of sources to be generated.

int* sources

Pointer to an array of int values which will store the names of the new sources.

GenSources(int)

This function generates one or more sources.

Declaration
public static int[] GenSources(int n)
Parameters
Type Name Description
int n

The number of sources to be generated.

Returns
Type Description
int[]

Pointer to an array of int values which will store the names of the new sources.

GenSources(int[])

This function generates one or more sources.

Declaration
public static void GenSources(int[] sources)
Parameters
Type Name Description
int[] sources

Pointer to an array of int values which will store the names of the new sources.

GenSources(Span<int>)

This function generates one or more sources.

Declaration
public static void GenSources(Span<int> sources)
Parameters
Type Name Description
Span<int> sources

Span of int values which will store the names of the new sources.

Get(ALGetFloat)

This function returns a floating-point OpenAL state.

Declaration
public static extern float Get(ALGetFloat param)
Parameters
Type Name Description
ALGetFloat param

the state to be queried: DopplerFactor, SpeedOfSound.

Returns
Type Description
float

The floating-point state described by param will be returned.

Get(ALGetInteger)

This function returns an integer OpenAL state.

Declaration
public static extern int Get(ALGetInteger param)
Parameters
Type Name Description
ALGetInteger param

the state to be queried: DistanceModel.

Returns
Type Description
int

The integer state described by param will be returned.

Get(ALGetString)

This function retrieves an OpenAL string property.

Declaration
public static extern string Get(ALGetString param)
Parameters
Type Name Description
ALGetString param

The property to be returned: Vendor, Version, Renderer and Extensions.

Returns
Type Description
string

Returns a pointer to a null-terminated string.

GetBuffer(int, ALGetBufferi, out int)

This function retrieves an integer property of a buffer.

Declaration
public static extern void GetBuffer(int bid, ALGetBufferi param, out int value)
Parameters
Type Name Description
int bid

Buffer name whose attribute is being retrieved.

ALGetBufferi param

The name of the attribute to be retrieved: ALGetBufferi.Frequency, Bits, Channels, Size, and the currently hidden AL_DATA (dangerous).

int value

A pointer to an int to hold the retrieved buffer.

GetBuffer(int, ALGetBufferi)

This function retrieves an integer property of a buffer.

Declaration
public static int GetBuffer(int bid, ALGetBufferi param)
Parameters
Type Name Description
int bid

Buffer name whose attribute is being retrieved.

ALGetBufferi param

The name of the attribute to be retrieved: ALGetBufferi.Frequency, Bits, Channels, Size, and the currently hidden AL_DATA (dangerous).

Returns
Type Description
int

An int to hold the retrieved buffer.

GetDistanceModel()

Returns the ALDistanceModel of the current context.

Declaration
public static ALDistanceModel GetDistanceModel()
Returns
Type Description
ALDistanceModel

The ALDistanceModel of the current context.

GetEnumValue(string)

This function returns the enumeration value of an OpenAL token, described by a string.

Declaration
public static extern int GetEnumValue(string ename)
Parameters
Type Name Description
string ename

A string describing an OpenAL token. Example "AL_DISTANCE_MODEL".

Returns
Type Description
int

Returns the actual ALenum described by a string. Returns 0 if the string doesn’t describe a valid OpenAL token.

GetError()

Error support. Obtain the most recent error generated in the AL state machine. 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 alGetError is called, the code is returned and the flag is cleared, so that a further error will again record its code.

Declaration
public static extern ALError GetError()
Returns
Type Description
ALError

The first error that occured. can be used with AL.GetString. Returns an Alenum representing the error state. When an OpenAL error occurs, the error state is set and will not be changed until the error state is retrieved using alGetError. Whenever alGetError is called, the error state is cleared and the last state (the current state when the call was made) is returned. To isolate error detection to a specific portion of code, alGetError should be called before the isolated section to clear the current error state.

GetErrorString(ALError)

This function retrieves an OpenAL string property.

Declaration
public static string GetErrorString(ALError param)
Parameters
Type Name Description
ALError param

The human-readable errorstring to be returned.

Returns
Type Description
string

Returns a pointer to a null-terminated string.

GetListener(ALListener3f, out Vector3)

This function retrieves a Vector3 from a property of the listener.

Declaration
public static void GetListener(ALListener3f param, out Vector3 values)
Parameters
Type Name Description
ALListener3f param

The name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity.

Vector3 values

A Vector3 to hold the three floats being retrieved.

GetListener(ALListener3f, out float, out float, out float)

This function retrieves a set of three floating-point values from a property of the listener.

Declaration
public static extern void GetListener(ALListener3f param, out float value1, out float value2, out float value3)
Parameters
Type Name Description
ALListener3f param

The name of the attribute to be retrieved.

float value1

The first floating-point value being retrieved.

float value2

The second floating-point value being retrieved.

float value3

The third floating-point value being retrieved.

GetListener(ALListener3f)

This function retrieves a Vector3 from a property of the listener.

Declaration
public static Vector3 GetListener(ALListener3f param)
Parameters
Type Name Description
ALListener3f param

The name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity.

Returns
Type Description
Vector3

A Vector3 to hold the three floats being retrieved.

GetListener(ALListenerf, out float)

This function retrieves a floating-point property of the listener.

Declaration
public static extern void GetListener(ALListenerf param, out float value)
Parameters
Type Name Description
ALListenerf param

the name of the attribute to be retrieved: ALListenerf.Gain.

float value

a pointer to the floating-point value being retrieved.

GetListener(ALListenerf)

This function retrieves a floating-point property of the listener.

Declaration
public static float GetListener(ALListenerf param)
Parameters
Type Name Description
ALListenerf param

the name of the attribute to be retrieved: ALListenerf.Gain.

Returns
Type Description
float

The floating-point value being retrieved.

GetListener(ALListenerfv, out Vector3, out Vector3)

This function retrieves two Vector3 properties of the listener.

Declaration
public static void GetListener(ALListenerfv param, out Vector3 at, out Vector3 up)
Parameters
Type Name Description
ALListenerfv param

the name of the attribute to be retrieved: ALListenerfv.Orientation.

Vector3 at

A Vector3 for the At-Vector.

Vector3 up

A Vector3 for the Up-Vector.

GetListener(ALListenerfv, float[])

This function retrieves a floating-point vector property of the listener. You must pin it manually.

Declaration
public static extern void GetListener(ALListenerfv param, float[] values)
Parameters
Type Name Description
ALListenerfv param

the name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity, ALListenerfv.Orientation.

float[] values

A pointer to the floating-point vector value being retrieved.

GetListener(ALListenerfv, ref float)

This function retrieves a floating-point vector property of the listener. You must pin it manually.

Declaration
public static extern void GetListener(ALListenerfv param, ref float values)
Parameters
Type Name Description
ALListenerfv param

the name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity, ALListenerfv.Orientation.

float values

A pointer to the floating-point vector value being retrieved.

GetListener(ALListenerfv, float*)

This function retrieves a floating-point vector property of the listener. You must pin it manually.

Declaration
public static extern void GetListener(ALListenerfv param, float* values)
Parameters
Type Name Description
ALListenerfv param

the name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity, ALListenerfv.Orientation.

float* values

A pointer to the floating-point vector value being retrieved.

GetProcAddress(string)

This function returns the address of an OpenAL extension function. Handle with care.

Declaration
public static extern IntPtr GetProcAddress(string fname)
Parameters
Type Name Description
string fname

A string containing the function name.

Returns
Type Description
IntPtr

The return value is a pointer to the specified function. The return value will be IntPtr.Zero if the function is not found.

GetSource(int, ALGetSourcei, out int)

This function retrieves an integer property of a source.

Declaration
public static extern void GetSource(int sid, ALGetSourcei param, out int value)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALGetSourcei param

The name of the attribute to retrieve: ALSourcei.SourceRelative, Buffer, SourceState, BuffersQueued, BuffersProcessed.

int value

A pointer to the integer value being retrieved.

GetSource(int, ALGetSourcei)

This function retrieves an integer property of a source.

Declaration
public static int GetSource(int sid, ALGetSourcei param)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALGetSourcei param

The name of the attribute to retrieve: ALSourcei.SourceRelative, Buffer, SourceState, BuffersQueued, BuffersProcessed.

Returns
Type Description
int

The integer value being retrieved.

GetSource(int, ALSource3f, out Vector3)

This function retrieves three floating-point values representing a property of a source.

Declaration
public static void GetSource(int sid, ALSource3f param, out Vector3 values)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSource3f param

The name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.

Vector3 values

A Vector3 to retrieve the values to.

GetSource(int, ALSource3f, out float, out float, out float)

This function retrieves three floating-point values representing a property of a source.

Declaration
public static extern void GetSource(int sid, ALSource3f param, out float value1, out float value2, out float value3)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSource3f param

The name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.

float value1

Pointer to the first value to retrieve.

float value2

Pointer to the second value to retrieve.

float value3

Pointer to the third value to retrieve.

GetSource(int, ALSource3f)

This function retrieves three floating-point values representing a property of a source.

Declaration
public static Vector3 GetSource(int sid, ALSource3f param)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSource3f param

The name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.

Returns
Type Description
Vector3

A Vector3 to with the received values.

GetSource(int, ALSource3i, out Vector3i)

This function retrieves three integer-point values representing a property of a source.

Declaration
public static void GetSource(int sid, ALSource3i param, out Vector3i values)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSource3i param

The name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.

Vector3i values

A Vector3i to retrieve the values to.

GetSource(int, ALSource3i, out int, out int, out int)

This function retrieves three integer-point values representing a property of a source.

Declaration
public static extern void GetSource(int sid, ALSource3i param, out int value1, out int value2, out int value3)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSource3i param

The name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.

int value1

Pointer to the first value to retrieve.

int value2

Pointer to the second value to retrieve.

int value3

Pointer to the third value to retrieve.

GetSource(int, ALSource3i)

This function retrieves three integer-point values representing a property of a source.

Declaration
public static Vector3i GetSource(int sid, ALSource3i param)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSource3i param

The name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.

Returns
Type Description
Vector3i

A Vector3i to retrieve the values to.

GetSource(int, ALSourceb, out bool)

This function retrieves a bool property of a source.

Declaration
public static void GetSource(int sid, ALSourceb param, out bool value)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSourceb param

The name of the attribute to get: ALSourceb.SourceRelative, Looping.

bool value

A pointer to the bool value being retrieved.

GetSource(int, ALSourceb)

This function retrieves a bool property of a source.

Declaration
public static bool GetSource(int sid, ALSourceb param)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSourceb param

The name of the attribute to get: ALSourceb.SourceRelative, Looping.

Returns
Type Description
bool

A the bool value being retrieved.

GetSource(int, ALSourcef, out float)

This function retrieves a floating-point property of a source.

Declaration
public static extern void GetSource(int sid, ALSourcef param, out float value)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSourcef param

The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, SecOffset, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.

float value

A pointer to the floating-point value being retrieved.

GetSource(int, ALSourcef)

This function retrieves a floating-point property of a source.

Declaration
public static float GetSource(int sid, ALSourcef param)
Parameters
Type Name Description
int sid

Source name whose attribute is being retrieved.

ALSourcef param

The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, SecOffset, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.

Returns
Type Description
float

The floating-point value being retrieved.

IsBuffer(int)

This function tests if a buffer name is valid, returning True if valid, False if not.

Declaration
public static extern bool IsBuffer(int bid)
Parameters
Type Name Description
int bid

A buffer Handle previously allocated with GenBuffers(int).

Returns
Type Description
bool

Success.

IsEnabled(ALCapability)

This function returns a boolean indicating if a specific feature is enabled in the OpenAL driver.

Declaration
public static extern bool IsEnabled(ALCapability capability)
Parameters
Type Name Description
ALCapability capability

The name of a capability to enable.

Returns
Type Description
bool

True if enabled, False if disabled.

IsExtensionPresent(string)

This function tests if a specific Extension is available for the OpenAL driver.

Declaration
public static extern bool IsExtensionPresent(string extname)
Parameters
Type Name Description
string extname

A string naming the desired extension. Example: "EAX-RAM".

Returns
Type Description
bool

Returns True if the Extension is available or False if not available.

IsSource(int)

This function tests if a source name is valid, returning True if valid and False if not.

Declaration
public static extern bool IsSource(int sid)
Parameters
Type Name Description
int sid

A source name to be tested for validity.

Returns
Type Description
bool

Success.

Listener(ALListener3f, ref Vector3)

This function sets a Vector3 property for the listener.

Declaration
public static void Listener(ALListener3f param, ref Vector3 values)
Parameters
Type Name Description
ALListener3f param

The name of the attribute to set.

Vector3 values

The Vector3 to set the attribute to.

Listener(ALListener3f, float, float, float)

This function sets a floating-point property for the listener.

Declaration
public static extern void Listener(ALListener3f param, float value1, float value2, float value3)
Parameters
Type Name Description
ALListener3f param

The name of the attribute to set.

float value1

The first value to set the attribute to.

float value2

The second value to set the attribute to.

float value3

The third value to set the attribute to.

Listener(ALListenerf, float)

This function sets a floating-point property for the listener.

Declaration
public static extern void Listener(ALListenerf param, float value)
Parameters
Type Name Description
ALListenerf param

The name of the attribute to be set.

float value

The float value to set the attribute to.

Listener(ALListenerfv, ref Vector3, ref Vector3)

This function sets two Vector3 properties of the listener.

Declaration
public static void Listener(ALListenerfv param, ref Vector3 at, ref Vector3 up)
Parameters
Type Name Description
ALListenerfv param

The name of the attribute to be set.

Vector3 at

A Vector3 for the At-Vector.

Vector3 up

A Vector3 for the Up-Vector.

Listener(ALListenerfv, float[])

This function sets a floating-point vector property of the listener.

Declaration
public static extern void Listener(ALListenerfv param, float[] values)
Parameters
Type Name Description
ALListenerfv param

The name of the attribute to be set.

float[] values

Pointer to floating-point vector values.

Listener(ALListenerfv, ref float)

This function sets a floating-point vector property of the listener.

Declaration
public static extern void Listener(ALListenerfv param, ref float values)
Parameters
Type Name Description
ALListenerfv param

The name of the attribute to be set.

float values

Pointer to floating-point vector values.

Listener(ALListenerfv, float*)

This function sets a floating-point vector property of the listener.

Declaration
public static extern void Listener(ALListenerfv param, float* values)
Parameters
Type Name Description
ALListenerfv param

The name of the attribute to be set.

float* values

Pointer to floating-point vector values.

Source(int, ALSource3f, ref Vector3)

This function sets a source property requiring three floating-point values.

Declaration
public static void Source(int sid, ALSource3f param, ref Vector3 values)
Parameters
Type Name Description
int sid

Source name whose attribute is being set.

ALSource3f param

The name of the attribute to set: ALSource3f.Position, Velocity, Direction.

Vector3 values

A Vector3 which the attribute will be set to.

Source(int, ALSource3f, float, float, float)

This function sets a source property requiring three floating-point values.

Declaration
public static extern void Source(int sid, ALSource3f param, float value1, float value2, float value3)
Parameters
Type Name Description
int sid

Source name whose attribute is being set.

ALSource3f param

The name of the attribute to set: ALSource3f.Position, Velocity, Direction.

float value1

The first ALfloat value which the attribute will be set to.

float value2

The second ALfloat value which the attribute will be set to.

float value3

The third ALfloat value which the attribute will be set to.

Source(int, ALSource3i, int, int, int)

This function sets 3 integer properties of a source.

Declaration
public static extern void Source(int sid, ALSource3i param, int value1, int value2, int value3)
Parameters
Type Name Description
int sid

Source name whose attribute is being set.

ALSource3i param

The name of the attribute to set: EfxAuxiliarySendFilter..

int value1

The first value to set the attribute to.

int value2

The second value to set the attribute to.

int value3

The third value to set the attribute to.

Source(int, ALSourceb, bool)

This function sets an bool property of a source.

Declaration
public static extern void Source(int sid, ALSourceb param, bool value)
Parameters
Type Name Description
int sid

Source name whose attribute is being set.

ALSourceb param

The name of the attribute to set: ALSourceb.SourceRelative, Looping.

bool value

The value to set the attribute to.

Source(int, ALSourcef, float)

This function sets a floating-point property of a source.

Declaration
public static extern void Source(int sid, ALSourcef param, float value)
Parameters
Type Name Description
int sid

Source name whose attribute is being set.

ALSourcef param

The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, SecOffset, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.

float value

The value to set the attribute to.

Source(int, ALSourcei, int)

This function sets an integer property of a source.

Declaration
public static extern void Source(int sid, ALSourcei param, int value)
Parameters
Type Name Description
int sid

Source name whose attribute is being set.

ALSourcei param

The name of the attribute to set: ALSourcei.SourceRelative, ConeInnerAngle, ConeOuterAngle, Looping, Buffer, SourceState.

int value

The value to set the attribute to.

SourcePause(int, int[])

This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.

Declaration
public static extern void SourcePause(int ns, int[] sids)
Parameters
Type Name Description
int ns

The number of sources to be paused.

int[] sids

A pointer to an array of sources to be paused.

SourcePause(int, ref int)

This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.

Declaration
public static extern void SourcePause(int ns, ref int sids)
Parameters
Type Name Description
int ns

The number of sources to be paused.

int sids

A pointer to an array of sources to be paused.

SourcePause(int, int*)

This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.

Declaration
public static extern void SourcePause(int ns, int* sids)
Parameters
Type Name Description
int ns

The number of sources to be paused.

int* sids

A pointer to an array of sources to be paused.

SourcePause(int)

This function pauses a source. The paused source will have its state changed to ALSourceState.Paused.

Declaration
public static extern void SourcePause(int sid)
Parameters
Type Name Description
int sid

The name of the source to be paused.

SourcePause(ReadOnlySpan<int>)

This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.

Declaration
public static void SourcePause(ReadOnlySpan<int> sources)
Parameters
Type Name Description
ReadOnlySpan<int> sources

The sources to be paused.

SourcePlay(int, int[])

This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.

Declaration
public static extern void SourcePlay(int ns, int[] sids)
Parameters
Type Name Description
int ns

The number of sources to be played.

int[] sids

A pointer to an array of sources to be played.

SourcePlay(int, ref int)

This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.

Declaration
public static extern void SourcePlay(int ns, ref int sids)
Parameters
Type Name Description
int ns

The number of sources to be played.

int sids

A pointer to an array of sources to be played.

SourcePlay(int, int*)

This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.

Declaration
public static extern void SourcePlay(int ns, int* sids)
Parameters
Type Name Description
int ns

The number of sources to be played.

int* sids

A pointer to an array of sources to be played.

SourcePlay(int)

This function plays, replays or resumes a source. The playing source will have it's state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.

Declaration
public static extern void SourcePlay(int sid)
Parameters
Type Name Description
int sid

The name of the source to be played.

SourcePlay(ReadOnlySpan<int>)

This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.

Declaration
public static void SourcePlay(ReadOnlySpan<int> sources)
Parameters
Type Name Description
ReadOnlySpan<int> sources

The sources to be played.

SourceQueueBuffer(int, int)

This function queues a set of buffers on a source. All buffers attached to a source will be played in sequence, and the number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed. When first created, a source will be of type ALSourceType.Undetermined. A successful AL.SourceQueueBuffers call will change the source type to ALSourceType.Streaming.

Declaration
public static void SourceQueueBuffer(int source, int buffer)
Parameters
Type Name Description
int source

The name of the source to queue buffers onto.

int buffer

The name of the buffer to be queued.

SourceQueueBuffers(int, int, int[])

This function queues a set of buffers on a source. All buffers attached to a source will be played in sequence, and the number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed. When first created, a source will be of type ALSourceType.Undetermined. A successful AL.SourceQueueBuffers call will change the source type to ALSourceType.Streaming.

Declaration
public static extern void SourceQueueBuffers(int sid, int numEntries, int[] bids)
Parameters
Type Name Description
int sid

The name of the source to queue buffers onto.

int numEntries

The number of buffers to be queued.

int[] bids

A pointer to an array of buffer names to be queued.

SourceQueueBuffers(int, int, ref int)

This function queues a set of buffers on a source. All buffers attached to a source will be played in sequence, and the number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed. When first created, a source will be of type ALSourceType.Undetermined. A successful AL.SourceQueueBuffers call will change the source type to ALSourceType.Streaming.

Declaration
public static extern void SourceQueueBuffers(int sid, int numEntries, ref int bids)
Parameters
Type Name Description
int sid

The name of the source to queue buffers onto.

int numEntries

The number of buffers to be queued.

int bids

A pointer to an array of buffer names to be queued.

SourceQueueBuffers(int, int, int*)

This function queues a set of buffers on a source. All buffers attached to a source will be played in sequence, and the number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed. When first created, a source will be of type ALSourceType.Undetermined. A successful AL.SourceQueueBuffers call will change the source type to ALSourceType.Streaming.

Declaration
public static extern void SourceQueueBuffers(int sid, int numEntries, int* bids)
Parameters
Type Name Description
int sid

The name of the source to queue buffers onto.

int numEntries

The number of buffers to be queued.

int* bids

A pointer to an array of buffer names to be queued.

SourceQueueBuffers(int, ReadOnlySpan<int>)

This function queues a set of buffers on a source. All buffers attached to a source will be played in sequence, and the number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed. When first created, a source will be of type ALSourceType.Undetermined. A successful AL.SourceQueueBuffers call will change the source type to ALSourceType.Streaming.

Declaration
public static void SourceQueueBuffers(int sid, ReadOnlySpan<int> buffers)
Parameters
Type Name Description
int sid

The name of the source to queue buffers onto.

ReadOnlySpan<int> buffers

A pointer to an array of buffer names to be queued.

SourceRewind(int, int[])

This function stops a set of sources and sets all their states to ALSourceState.Initial.

Declaration
public static extern void SourceRewind(int ns, int[] sids)
Parameters
Type Name Description
int ns

The number of sources to be rewound.

int[] sids

A pointer to an array of sources to be rewound.

SourceRewind(int, ref int)

This function stops a set of sources and sets all their states to ALSourceState.Initial.

Declaration
public static extern void SourceRewind(int ns, ref int sids)
Parameters
Type Name Description
int ns

The number of sources to be rewound.

int sids

A pointer to an array of sources to be rewound.

SourceRewind(int, int*)

This function stops a set of sources and sets all their states to ALSourceState.Initial.

Declaration
public static extern void SourceRewind(int ns, int* sids)
Parameters
Type Name Description
int ns

The number of sources to be rewound.

int* sids

A pointer to an array of sources to be rewound.

SourceRewind(int)

This function stops the source and sets its state to ALSourceState.Initial.

Declaration
public static extern void SourceRewind(int sid)
Parameters
Type Name Description
int sid

The name of the source to be rewound.

SourceRewind(ReadOnlySpan<int>)

This function stops a set of sources and sets all their states to ALSourceState.Initial.

Declaration
public static void SourceRewind(ReadOnlySpan<int> sources)
Parameters
Type Name Description
ReadOnlySpan<int> sources

The sources to be rewound.

SourceStop(int, int[])

This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.

Declaration
public static extern void SourceStop(int ns, int[] sids)
Parameters
Type Name Description
int ns

The number of sources to stop.

int[] sids

A pointer to an array of sources to be stopped.

SourceStop(int, ref int)

This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.

Declaration
public static extern void SourceStop(int ns, ref int sids)
Parameters
Type Name Description
int ns

The number of sources to stop.

int sids

A pointer to an array of sources to be stopped.

SourceStop(int, int*)

This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.

Declaration
public static extern void SourceStop(int ns, int* sids)
Parameters
Type Name Description
int ns

The number of sources to stop.

int* sids

A pointer to an array of sources to be stopped.

SourceStop(int)

This function stops a source. The stopped source will have it's state changed to ALSourceState.Stopped.

Declaration
public static extern void SourceStop(int sid)
Parameters
Type Name Description
int sid

The name of the source to be stopped.

SourceStop(ReadOnlySpan<int>)

This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.

Declaration
public static void SourceStop(ReadOnlySpan<int> sources)
Parameters
Type Name Description
ReadOnlySpan<int> sources

The sources to be stopped.

SourceUnqueueBuffer(int)

This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.

Declaration
public static int SourceUnqueueBuffer(int sid)
Parameters
Type Name Description
int sid

The name of the source to unqueue buffers from.

Returns
Type Description
int

The unqueued buffer.

SourceUnqueueBuffers(int, int, int[])

This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.

Declaration
public static extern void SourceUnqueueBuffers(int sid, int numEntries, int[] bids)
Parameters
Type Name Description
int sid

The name of the source to unqueue buffers from.

int numEntries

The number of buffers to be unqueued.

int[] bids

A pointer to an array of buffer names that were removed.

SourceUnqueueBuffers(int, int, ref int)

This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.

Declaration
public static extern void SourceUnqueueBuffers(int sid, int numEntries, ref int bids)
Parameters
Type Name Description
int sid

The name of the source to unqueue buffers from.

int numEntries

The number of buffers to be unqueued.

int bids

A pointer to an array of buffer names that were removed.

SourceUnqueueBuffers(int, int, int*)

This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.

Declaration
public static extern void SourceUnqueueBuffers(int sid, int numEntries, int* bids)
Parameters
Type Name Description
int sid

The name of the source to unqueue buffers from.

int numEntries

The number of buffers to be unqueued.

int* bids

A pointer to an array of buffer names that were removed.

SourceUnqueueBuffers(int, int)

This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.

Declaration
public static int[] SourceUnqueueBuffers(int sid, int numEntries)
Parameters
Type Name Description
int sid

The name of the source to unqueue buffers from.

int numEntries

The number of buffers to be unqueued.

Returns
Type Description
int[]

The unqueued buffers.

SourceUnqueueBuffers(int, int[])

This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.

Declaration
public static void SourceUnqueueBuffers(int sid, int[] bids)
Parameters
Type Name Description
int sid

The name of the source to unqueue buffers from.

int[] bids

Array to fill with buffer names that were removed.

SourceUnqueueBuffers(int, Span<int>)

This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.

Declaration
public static void SourceUnqueueBuffers(int sid, Span<int> bids)
Parameters
Type Name Description
int sid

The name of the source to unqueue buffers from.

Span<int> bids

Span to fill with buffer names that were removed.

SpeedOfSound(float)

AL.SpeedOfSound allows the application to change the reference (propagation) speed used in the Doppler calculation. The source and listener velocities should be expressed in the same units as the speed of sound.

Declaration
public static extern void SpeedOfSound(float value)
Parameters
Type Name Description
float value

A negative or zero value will result in an error, and the command is ignored. Default: 343.3f (appropriate for velocity units of meters and air as the propagation medium). The current setting can be queried using AL.Get with parameter ALGetFloat.SpeedOfSound.

In This Article
Back to top Generated by DocFX