BlitzMax

BlitzMax

  • Downloads
  • Docs
  • API
  • Resources
  • About

›PUB

BlitzMax API

  • Introduction

BRL

    Audio

    • Introduction
    • TChannel
    • TSound

    AudioSample

    • Introduction
    • TAudioSample
    • TAudioSampleLoader

    Bank

    • Introduction
    • TBank

    BankStream

    • Introduction
    • TBankStream

    Base64

    • Introduction
    • TBase64

    Blitz

    • Introduction
    • TArrayBoundsException
    • TBlitzException
    • TNullFunctionException
    • TNullMethodException
    • TNullObjectException
    • TOutOfDataException
    • TRuntimeException
  • BRL.BMPLoader
  • Clipboard

    • Introduction
    • TClipboard
    • TClipboardOpts
    • TWin32ClipboardOpts
    • TX11ClipboardOpts
  • BRL.D3D7Max2D
  • BRL.D3D9Max2D
  • BRL.DirectSoundAudio
  • BRL.EndianStream
  • Event

    • Introduction
    • TEvent
  • BRL.EventQueue
  • BRL.FileSystem
  • BRL.FreeAudioAudio
  • BRL.GLGraphics
  • BRL.GLMax2D
  • BRL.GNet
  • BRL.Graphics
  • BRL.Hook
  • BRL.JPGLoader
  • BRL.KeyCodes
  • LinkedList

    • Introduction
    • TList
    • TListEnum
    • TLink

    Map

    • Introduction
    • TMap
    • TIntMap
    • TIntKey
    • TPtrMap
    • TPtrKey
    • TStringMap
  • BRL.Math
  • Matrix

    • Introduction
    • SMat2D
    • SMat2F
    • SMat2I
    • SMat3D
    • SMat3F
    • SMat3I
    • SMat4D
    • SMat4F
    • SMat4I

    Max2D

    • Introduction
    • TImage

    MaxLua

    • Introduction
    • TLuaClass
    • TLuaObject
  • BRL.OGGLoader
  • BRL.OpenALAudio
  • ObjectList

    • Introduction
    • TObjectList
    • TObjectListEnumerator
    • TObjectListReverseEnumerator

    Pixmap

    • Introduction
    • TPixmap
    • TPixmapLoader
  • BRL.PNGLoader
  • BRL.PolledInput
  • Quaternion

    • Introduction
    • SQuatD
    • SQuatF
    • SQuatI
  • BRL.RamStream
  • Random

    • Introduction
    • TRandom

    Reflection

    • Introduction
    • TTypeId
    • TMember
    • TConstant
    • TField
    • TGlobal
    • TFunction
    • TMethod
  • BRL.Retro
  • BRL.Socket
  • BRL.SocketStream
  • BRL.StandardIO
  • Stream

    • Introduction
    • TCStream
    • TIO
    • TStream
    • TStreamException
    • TStreamFactory
    • TStreamReadException
    • TStreamWrapper
    • TStreamWriteException

    StringBuilder

    • Introduction
    • TStringBuilder
    • TSplitBuffer
  • BRL.System
  • BRL.SystemDefault
  • BRL.TextStream
  • BRL.TGALoader
  • ThreadPool

    • Introduction
    • TRunnable
    • TThreadPoolExecutor

    Threads

    • Introduction
    • TThread
    • TThreadData
    • TMutex
    • TSemaphore
    • TCondVar

    Timer

    • Introduction
    • TChrono
  • BRL.TimerDefault
  • Vector

    • Introduction
    • SVec2D
    • SVec2F
    • SVec2I
    • SVec3D
    • SVec3F
    • SVec3I

    Volumes

    • Introduction
    • TVolume
  • BRL.WAVLoader

Text

    Format

    • Introduction
    • TFormatter

    JConv

    • Introduction
    • TJConv
    • TJConvBuilder
    • TJConvSerializer

    Json

    • Introduction
    • TJSON
    • TJSONObject
    • TJSONString
    • TJSONInteger
    • TJSONReal
    • TJSONBool
    • TJSONArray
    • TJSONNull
    • TJSONError
    • TJSONNumber

    Regex

    • Introduction
    • TRegEx
    • TRegExMatch
    • TRegExOptions
    • TRegExException

    Xml

    • Introduction
    • TxmlDoc
    • TxmlNode
    • TxmlAttribute

MaxGUI

  • MaxGUI.MaxGUI
  • MaxGUI.Drivers
  • MaxGUI.Localization
  • MaxGUI.ProxyGadgets
  • MaxGUI.CocoaMaxGUI
  • MaxGUI.Win32MaxGUIEx

PUB

  • Pub.FreeJoy
  • Pub.FreeProcess
  • Pub.Glad
  • Pub.Glew
  • Joystick

    • Introduction
    • TJoystickDriver
  • Pub.Lua
  • Pub.OpenAL
  • Pub.OpenGLES
  • Pub.xmmintrin
  • Pub.ZLib

Crypto

    Digest

    • Introduction
    • TMessageDigest
    • TDigestRegister
    • TNoSuchAlgorithmException

    Cipher

    • Introduction
    • TCipher
    • TCipherMode
    • Crypto.AESCipher
    • Crypto.AnubisCipher
    • Crypto.BlowfishCipher
    • Crypto.CamelliaCipher
    • Crypto.Cast5Cipher
    • Crypto.DESCipher
    • Crypto.IdeaCipher
    • Crypto.KasumiCipher
    • Crypto.KhazadCipher
    • Crypto.KSeedCipher
    • Crypto.NoekeonCipher
    • Crypto.SerpentCipher
    • Crypto.SkipjackCipher
    • Crypto.TwofishCipher
    • Crypto.XTeaCipher

    CBCMode

    • Introduction
    • TCBCCipherMode

    CFBMode

    • Introduction
    • TCFBCipherMode

    CTRMode

    • Introduction
    • TCTRCipherMode

    ECBMode

    • Introduction
    • TECBCipherMode

    F8Mode

    • Introduction
    • TF8CipherMode

    LRWMode

    • Introduction
    • TLRWCipherMode

    OFBMode

    • Introduction
    • TOFBCipherMode

    XTSMode

    • Introduction
    • TXTSCipherMode

    Blake2BDigest

    • Introduction
    • TBlake2B_512
    • TBlake2B_384
    • TBlake2B_256
    • TBlake2B_160

    CRC32

    • Introduction
    • TCRC32

    MD5Digest

    • Introduction
    • TMD5

    Ripemd320Digest

    • Introduction
    • TRipemd320

    Ripemd356Digest

    • Introduction
    • TRipemd256

    Ripemd160Digest

    • Introduction
    • TRipemd160

    Ripemd128Digest

    • Introduction
    • TRipemd128

    SHA1Digest

    • Introduction
    • TSHA1

    SHA256Digest

    • Introduction
    • TSHA256

    SHA512Digest

    • Introduction
    • TSHA512

    SHA3Digest

    • Introduction
    • TSHA3_512
    • TSHA3_384
    • TSHA3_256
    • TSHA3_224

    TigerDigest

    • Introduction
    • TTiger

    WhirlpoolDigest

    • Introduction
    • TWhirlpool

    Crypto

    • Introduction
    • TCryptoRandom
    • TCryptoSecretBox
    • TCryptoHash
    • TCryptoSign
    • TCryptoKeyExchange
    • TCryptoKey
    • TCryptoHashKey
    • TCryptoSecretBoxKey
    • TCryptoSignature
    • TCryptoExchangeKeyPair
    • TCryptoSessionKeyPair
    • TCryptoNPacket
    • TCryptoKK1Packet
    • TCryptoKK2Packet
    • TCryptoXX1Packet
    • TCryptoXX2Packet
    • TCryptoXX3Packet
    • TCryptoExchangeState
    • TCryptoPWHashMasterKey
    • TCryptoPWHashStoredKey
    • TCryptoPasswordHash

SDL

    SDL

    • Introduction
    • TSDLStream

    SDLSystem

    • Introduction
    • TSDLMultiGesture

    SDLVideo

    • Introduction
    • TSDLDisplay
    • TSDLDisplayMode
    • TSDLGLContext
    • TSDLWindow

    SDLRender

    • Introduction
    • TSDLRenderer
    • TSDLTexture

    SDLTimer

    • Introduction
    • TSDLTimer

    SDLHaptic

    • Introduction
    • TSDLHaptic
    • TSDLHapticCondition
    • TSDLHapticConstant
    • TSDLHapticCustom
    • TSDLHapticDirection
    • TSDLHapticEffect
    • TSDLHapticLeftRight
    • TSDLHapticPeriodic
    • TSDLHapticRamp

    SDLSensor

    • Introduction
    • TSDLSensor
  • SDL.SDLFreeAudio
  • SDL.GLSDLMax2D
  • SDL.GL2SDLMax2D
  • SDL.D3D9SDLMax2D
  • SDLVirtualJoystick

    • Introduction
    • TVirtualJoystick

Steam

    SteamSDK

    • Introduction
    • TSteamClient
    • TSteamUtils
    • TSteamUserStats
    • TSteamFriends
    • TSteamUGC
    • ISteamFriendsListener
    • ISteamUGCListener
    • ISteamUserStatsListener
    • ISteamUtilsListener
    • EItemPreviewType
    • EPersonaChange
    • EPersonaState
    • ERemoteStoragePublishedFileVisibility
    • EUGCMatchingUGCType
    • EUGCQuery
    • EUserRestriction
    • EUserUGCList
    • EWorkshopFileType
Edit

Pub.OpenAL

ConstantsDescription
AL_INVALID
AL_NONE
bad value
AL_FALSEBoolean False.
AL_TRUEBoolean True.
AL_SOURCE_RELATIVEIndicate Source has relative coordinates.
AL_CONE_INNER_ANGLEDirectional source, inner cone angle, in degrees.
Range: [0-360]
Default: 360
AL_CONE_OUTER_ANGLEDirectional source, outer cone angle, in degrees.
Range: [0-360]
Default: 360
AL_PITCHSpecify the pitch to be applied, either at source,or on mixer results, at listener.
Range: [0.5-2.0]
Default: 1.0
AL_POSITIONSpecify the current location in three dimensional space.
OpenAL, like OpenGL, uses a right handed coordinate system, where in a frontal default view X (thumb) points right, Y points up (index finger), and Z points towards the viewer/camera (middle finger).
To switch from a left handed coordinate system, flip the sign on the Z coordinate.
Listener position is always in the world coordinate system.
AL_DIRECTIONSpecify the current direction.
AL_VELOCITYSpecify the current velocity in three dimensional space.
AL_LOOPINGIndicate whether source is looping.
Type: ALboolean?
Range: [AL_TRUE, AL_FALSE]
Default: FALSE.
AL_BUFFERIndicate the buffer to provide sound samples.
Type: ALuint.
Range: any valid Buffer id.
AL_GAINIndicate the gain (volume amplification) applied.
Type: ALfloat.
Range: ]0.0- ]
A value of 1.0 means un-attenuated/unchanged.
Each division by 2 equals an attenuation of -6dB.
Each multiplicaton with 2 equals an amplification of +6dB.
A value of 0.0 is meaningless with respect to a logarithmic scale; it is interpreted as zero volume - the channel is effectively disabled.
AL_MIN_GAINIndicate minimum source attenuation
Type: ALfloat
Range: [0.0 - 1.0]
AL_MAX_GAINIndicate maximum source attenuation
Type: ALfloat
Range: [0.0 - 1.0]
AL_ORIENTATIONIndicate listener orientation.
AL_CHANNEL_MASKSpecify the channel mask. (Creative)
Type: ALuint
Range: [0 - 255]
AL_SOURCE_STATE
AL_INITIAL
AL_PLAYING
AL_PAUSED
AL_STOPPED
Source state information.
AL_BUFFERS_QUEUED
AL_BUFFERS_PROCESSED
Buffer Queue params
AL_SEC_OFFSET
AL_SAMPLE_OFFSET
AL_BYTE_OFFSET
Source buffer position information
AL_SOURCE_TYPESource type (Static, Streaming or undetermined)
AL_STATICSource is Static if a Buffer has been attached using AL_BUFFER
AL_STREAMINGSource is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
AL_UNDETERMINEDSource is undetermined when it has the NULL buffer attached
AL_FORMAT_MONO8
AL_FORMAT_STEREO8
AL_FORMAT_MONO16
AL_FORMAT_STEREO16
Sound samples: format specifier.
AL_REFERENCE_DISTANCEsource specific reference distance
Type: ALfloat
Range: 0.0 - +inf

at 0.0, no distance attenuation occurs. Default is 1.0.
AL_ROLLOFF_FACTORsource specific rolloff factor
Type: ALfloat
Range: 0.0 - +inf
AL_CONE_OUTER_GAINDirectional source, outer cone gain.
Default: 0.0
Range: [0.0 - 1.0]
AL_MAX_DISTANCEIndicate distance above which sources are not attenuated using the inverse clamped distance model.
Default: +inf
Type: ALfloat
AL_FREQUENCY
AL_BITS
AL_CHANNELS
AL_SIZE
frequency, in units of Hertz [Hz].
This is the number of samples per second. Half of the sample frequency marks the maximum significant frequency component.
AL_UNUSED
AL_PENDING
AL_PROCESSED
Buffer state.
not supported for public use (yet).
AL_NO_ERRORNo Error
AL_INVALID_NAMEInvalid Name paramater passed to AL call.
AL_ILLEGAL_ENUM
AL_INVALID_ENUM
Invalid parameter passed to AL call.
AL_INVALID_VALUEInvalid enum parameter value.
AL_ILLEGAL_COMMAND
AL_INVALID_OPERATION
Illegal call.
AL_OUT_OF_MEMORYNo mojo.
AL_VENDOR
AL_VERSION
AL_RENDERER
AL_EXTENSIONS
Context strings: Vendor Name.
AL_DOPPLER_FACTORDoppler scale. Default 1.0
AL_DOPPLER_VELOCITYTweaks speed of propagation.
AL_SPEED_OF_SOUNDSpeed of Sound in units per second
AL_DISTANCE_MODEL
AL_INVERSE_DISTANCE
AL_INVERSE_DISTANCE_CLAMPED
AL_LINEAR_DISTANCE
AL_LINEAR_DISTANCE_CLAMPED
AL_EXPONENT_DISTANCE
AL_EXPONENT_DISTANCE_CLAMPED
Distance models

used in conjunction with DistanceModel

implicit: NONE, which disances distance attenuation.

ALC constantsDescription
ALC_FALSEFalse
ALC_TRUETrue
ALC_FREQUENCYFrequency for mixing output buffer, in units of Hz
ALC_REFRESHRefresh intervals, in units of Hz
ALC_SYNCFlag, indicating a synchronous context
ALC_MONO_SOURCESA hint indicating how many sources should be capable of supporting mono data
ALC_STEREO_SOURCESA hint indicating how many sources should be capable of supporting stereo data
ALC_NO_ERRORThere is no current error.
ALC_INVALID_DEVICEThe device handle or specifier names an accessible driver/server
ALC_INVALID_CONTEXTThe Context argument does not name a valid context.
ALC_INVALID_ENUMA token used is not valid, or not applicable.
ALC_INVALID_VALUEA value (e.g. Attribute) is not valid, or not applicable.
ALC_OUT_OF_MEMORYUnable to allocate memory.
ALC_DEFAULT_DEVICE_SPECIFIERThe specifier string for the default device
ALC_DEVICE_SPECIFIERThe specifier string for the device
ALC_EXTENSIONSA list of available context extensions separated by spaces.
ALC_MAJOR_VERSIONThe specification revision for this implementation (major version). NULL is an acceptable device.
ALC_MINOR_VERSIONThe specification revision for this implementation (minor version). NULL is an acceptable device.
ALC_ATTRIBUTES_SIZEThe size (number of ALCint values) required for a zero-terminated attributes list, for the current context. NULL is an invalid device.
ALC_ALL_ATTRIBUTESExpects a destination of ALC_ATTRIBUTES_SIZE, and provides an attribute list for the current context of the specified device. NULL is an invalid device.
ALC_CAPTURE_DEVICE_SPECIFIERThe name of the specified capture device, or a list of all available capture devices if no capture device is specified.
ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIERThe name of the default capture device
ALC_CAPTURE_SAMPLESThe number of capture samples available. NULL is an invalid device.

Functions

Function OpenALInstalled()

Check if OpenAL is installed.

This function allows you to determine whether OpenAL is installed on the current machine.

Returns

True if OpenAL is installed.


Globals

Global alcOpenDevice:Byte Ptr( devicename$z )

This function opens a device by name.

ParametersDescription
devicenamea null-terminated string describing a device

The return value will be NULL if there is an error.

Returns a pointer to the opened device. Will return NULL if a device can not be opened.


Global alcCloseDevice( device:Byte Ptr )

This function closes a device by name.

ParametersDescription
devicea pointer to an opened device

Possible Error StatesDescription
ALC_INVALID_DEVICEThe specified device name doesn't exist.

Any contexts and buffers within the device will be destroyed when the device is closed, and ALC_TRUE will be returned on success or ALC_FALSE on failure.


Global alcGetError( device:Byte Ptr )

This function retrieves the current context error state.

ParametersDescription
devicea pointer to the device to retrieve the error state from


Global alcGetString:Byte Ptr( device:Byte Ptr,param )

This function returns pointers to strings related to the context.

ParametersDescription
devicea pointer to the device to be queried
paraman attribute to be retrieved:
ALC_DEFAULT_DEVICE_SPECIFIER
ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER
ALC_DEVICE_SPECIFIER
ALC_CAPTURE_DEVICE_SPECIFIER
ALC_EXTENSIONS

Possible Error StatesDescription
ALC_INVALID_ENUMThe specified parameter is not valid.

ALC_DEFAULT_DEVICE_SPECIFIER will return the name of the default output device.

ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER will return the name of the default capture device.

ALC_DEVICE_SPECIFIER will return the name of the specified output device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied. A list is a pointer to a series of strings separated by NULL characters, with the list terminated by two NULL characters.

ALC_CAPTURE_DEVICE_SPECIFIER will return the name of the specified capture device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied.

ALC_EXTENSIONS returns a list of available context extensions, with each extension separated by a space and the list terminated by a NULL character.


Global alcGetIntegerv( device:Byte Ptr,param,size,data:Int Ptr )

This function returns integers related to the context.

ParametersDescription
devicea pointer to the device to be queried
paraman attribute to be retrieved:
ALC_MAJOR_VERSION
ALC_MINOR_VERSION
ALC_ATTRIBUTES_SIZE
ALC_ALL_ATTRIBUTES
sizethe size of the destination buffer provided
dataa pointer to the data to be returned

Possible Error StatesDescription
ALC_INVALID_VALUEThe specified data pointer or size is not valid.
ALC_INVALID_ENUMThe specified parameter is not valid.
ALC_INVALID_DEVICEThe specified device is not valid.
ALC_INVALID_CONTEXTThe specified context is not valid.

The versions returned refer to the specification version that the implementation meets.


Global alcCreateContext:Byte Ptr( device:Byte Ptr,attrlist:Int Ptr )

This function creates a context using a specified device.

ParametersDescription
devicea pointer to a device
attrlista pointer to a set of attributes:
ALC_FREQUENCY
ALC_REFRESH
ALC_SYNC

Possible Error StatesDescription
ALC_INVALID_VALUEAn additional context can not be created for this device.
ALC_INVALID_DEVICEThe specified device is not a valid output device.

Returns

A pointer to the new context (NULL on failure).


Global alcMakeContextCurrent( context:Byte Ptr )

This function makes a specified context the current context.

ParametersDescription
contexta pointer to the new context

Possible Error StatesDescription
ALC_INVALID_CONTEXTThe specified context is invalid.

Returns ALC_TRUE on success, or ALC_FALSE on failure.


Global alcProcessContext( context:Byte Ptr )

This function tells a context to begin processing.

ParametersDescription
contexta pointer to the new context

Possible Error StatesDescription
ALC_INVALID_CONTEXTThe specified context is invalid.

When a context is suspended, changes in OpenAL state will be accepted but will not be processed. [alcSuspendContext](../../pub/pub.openal/#global-alcsuspendcontext-contextbyte-ptr-) can be used to suspend a context, and then all the OpenAL state changes can be applied at once, followed by a call to alcProcessContext to apply all the state changes immediately. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.


Global alcSuspendContext( context:Byte Ptr )

This function suspends processing on a specified context.

ParametersDescription
contexta pointer to the context to be suspended

Possible Error StatesDescription
ALC_INVALID_CONTEXTThe specified context is invalid.

When a context is suspended, changes in OpenAL state will be accepted but will not be processed. A typical use of alcSuspendContext would be to suspend a context, apply all the OpenAL state changes at once, and then call [alcProcessContext](../../pub/pub.openal/#global-alcprocesscontext-contextbyte-ptr-) to apply all the state changes at once. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.


Global alcDestroyContext( context:Byte Ptr )

This function destroys a context.

ParametersDescription
contexta pointer to the new context

Possible Error StatesDescription
ALC_INVALID_CONTEXTThe specified context is invalid.

A context which is not current can be destroyed at any time (all sources within that context will also be deleted - buffers are not affected). [alcMakeContextCurrent](../../pub/pub.openal/#global-alcmakecontextcurrent-contextbyte-ptr-) should be used to make sure the context to be destroyed is not current (NULL is valid for [alcMakeContextCurrent](../../pub/pub.openal/#global-alcmakecontextcurrent-contextbyte-ptr-)).


Global alcGetCurrentContext:Byte Ptr()

This function retrieves the current context.

Returns

a pointer to the current context.


Global alcGetContextsDevice:Byte Ptr( context:Byte Ptr )

This function retrieves a context's device pointer.

ParametersDescription
contexta pointer to a context

Possible Error StatesDescription
ALC_INVALID_CONTEXTThe specified context is invalid.

Returns

a pointer to the specified context's device.


Global alcIsExtensionPresent( device:Byte Ptr,extName$z )

This function queries if a specified context extension is available.

ParametersDescription
devicea pointer to the device to be queried for an extension
extNamea null-terminated string describing the extension

Possible Error StatesDescription
ALC_INVALID_VALUEThe string pointer is not valid.

Returns ALC_TRUE if the extension is available, ALC_FALSE if the extension is not available.


Global alcGetProcAddress:Byte Ptr( device:Byte Ptr,funcName$z )

This function retrieves the address of a specified context extension function.

ParametersDescription
devicea pointer to the device to be queried for the function
funcNamea null-terminated string describing the function

Possible Error StatesDescription
ALC_INVALID_VALUEThe string pointer is not valid.

Returns the address of the function, or NULL if it is not found.


Global alcGetEnumValue( device:Byte Ptr,enumName$z )

This function retrieves the enum value for a specified enumeration name.

ParametersDescription
devicea pointer to the device to be queried
enumNamea null terminated string describing the enum value

Possible Error StatesDescription
ALC_INVALID_VALUEThe string pointer is not valid.

Returns the enum value described by the enumName string. This is most often used for querying an enum value for an ALC extension.


Global alcCaptureOpenDevice:Byte Ptr( devicename$z,frequency,format,buffersize )

This function opens a capture device by name.

ParametersDescription
devicenamea pointer to a device name string
frequencythe frequency that the data should be captured at
formatthe requested capture buffer format
buffersizethe size of the capture buffer

Possible Error StatesDescription
ALC_INVALID_VALUEOne of the parameters has an invalid value.
ALC_OUT_OF_MEMORYThe specified device is invalid, or can not capture audio.

Returns the capture device pointer, or NULL on failure.


Global alcCaptureCloseDevice( device:Byte Ptr )

This function closes the specified capture device.

ParametersDescription
devicea pointer to a capture device

Possible Error StatesDescription
ALC_INVALID_DEVICEThe specified device is not a valid capture device.

Returns ALC_TRUE if the close operation was successful, ALC_FALSE on failure.


Global alcCaptureStart( device:Byte Ptr )

This function begins a capture operation.

ParametersDescription
devicea pointer to a capture device

Possible Error StatesDescription
ALC_INVALID_DEVICEThe specified device is not a valid capture device.

alcCaptureStart will begin recording to an internal ring buffer of the size specified when opening the capture device. The application can then retrieve the number of samples currently available using the ALC_CAPTURE_SAPMPLES token with [alcGetIntegerv](../../pub/pub.openal/#global-alcgetintegerv-devicebyte-ptrparamsizedataint-ptr-). When the application determines that enough samples are available for processing, then it can obtain them with a call to [alcCaptureSamples](../../pub/pub.openal/#global-alccapturesamples-devicebyte-ptrbufferbyte-ptrsamples-).


Global alcCaptureStop( device:Byte Ptr )

This function stops a capture operation.

ParametersDescription
devicea pointer to a capture device

Possible Error StatesDescription
ALC_INVALID_DEVICEThe specified device is not a valid capture device.


Global alcCaptureSamples( device:Byte Ptr,buffer:Byte Ptr,samples )

This function completes a capture operation.

ParametersDescription
devicea pointer to a capture device
buffera pointer to a data buffer, which must be large enough to accommodate samples number of samples
samplesthe number of samples to be retrieved

Possible Error StatesDescription
ALC_INVALID_VALUEThe specified number of samples is larger than the number of available samples.
ALC_INVALID_DEVICEThe specified device is not a valid capture device.


Global alEnable( capability )

This function enables a feature of the OpenAL driver.

ParametersDescription
capabilitythe name of a capability to enable

Possible Error StatesDescription
AL_INVALID_ENUMThe specified capability is not valid.
AL_INVALID_OPERATIONThere is no current context.

There are no capabilities defined in OpenAL 1.1 to be used with this function, but it may be used by an extension.


Global alDisable( capability )

This function disables a feature of the OpenAL driver.

ParametersDescription
capabilitythe name of a capability to disable

Possible Error StatesDescription
AL_INVALID_ENUMThe specified capability is not valid.
AL_INVALID_OPERATIONThere is no current context.

There are no capabilities defined in OpenAL 1.1 to be used with this function, but it may be used by an extension.


Global alIsEnabled( capability )

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

ParametersDescription
capabilitythe name of a capability to disable

Possible Error StatesDescription
AL_INVALID_ENUMThe specified capability is not valid.
AL_INVALID_OPERATIONThere is no current context.

Returns AL_TRUE if the capability is enabled, AL_FALSE if the capability is disabled. There are no capabilities defined in OpenAL 1.1 to be used with this function, but it may be used by an extension.


Global alGetString:Byte Ptr( param )

This function retrieves an OpenAL string property.

ParametersDescription
paramThe property to be returned:
AL_VENDOR
AL_VERSION
AL_RENDERER
AL_EXTENSIONS

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.

Returns a pointer to a null-terminated string.


Global alGetBooleanv( param,data:Byte Ptr )

This function retrieves a boolean OpenAL state.

ParametersDescription
paramthe state to be returned:
AL_DOPPLER_FACTOR
AL_SPEED_OF_SOUND
AL_DISTANCE_MODEL
dataa pointer to the location where the state will be stored

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_VALUEThe specified data pointer is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetIntegerv( param,data:Int Ptr )

This function retrieves an integer OpenAL state.

ParametersDescription
paramthe state to be returned:
AL_DOPPLER_FACTOR
AL_SPEED_OF_SOUND
AL_DISTANCE_MODEL
dataa pointer to the location where the state will be stored

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_VALUEThe specified data pointer is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetFloatv( param,data:Float Ptr )

This function retrieves a floating point OpenAL state.

ParametersDescription
paramthe state to be returned:
AL_DOPPLER_FACTOR
AL_SPEED_OF_SOUND
AL_DISTANCE_MODEL
dataa pointer to the location where the state will be stored

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_VALUEThe specified data pointer is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetDoublev( param,data:Double Ptr )

This function retrieves a double precision floating point OpenAL state.

ParametersDescription
paramthe state to be returned:
AL_DOPPLER_FACTOR
AL_SPEED_OF_SOUND
AL_DISTANCE_MODEL
dataa pointer to the location where the state will be stored

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_VALUEThe specified data pointer is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetBoolean( param )

This function returns a boolean OpenAL state.

ParametersDescription
paramthe state to be queried:
AL_DOPPLER_FACTOR
AL_SPEED_OF_SOUND
AL_DISTANCE_MODEL

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.

The boolean state described by param will be returned.


Global alGetInteger( param )

This function returns an integer OpenAL state.

ParametersDescription
paramthe state to be queried:
AL_DOPPLER_FACTOR
AL_SPEED_OF_SOUND
AL_DISTANCE_MODEL

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.

The integer state described by param will be returned.


Global alGetFloat#( param )

This function returns a floating point OpenAL state.

ParametersDescription
paramthe state to be queried:
AL_DOPPLER_FACTOR
AL_SPEED_OF_SOUND
AL_DISTANCE_MODEL

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.

The floating point state described by param will be returned.


Global alGetDouble!( param )

This function returns a double precision floating point OpenAL state.

ParametersDescription
paramthe state to be queried:
AL_DOPPLER_FACTOR
AL_SPEED_OF_SOUND
AL_DISTANCE_MODEL

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.

The double value described by param will be returned.


Global alGetError()

This function returns the current error state and then clears the error state.

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.


Global alIsExtensionPresent( extname$z )

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

ParametersDescription
extnamea null-terminated string describing the desired extension

Possible Error StatesDescription
AL_INVALID_VALUEThe specified extension string is not a valid pointer.

Returns AL_TRUE if the extension is available, AL_FALSE if the extension is not available.


Global alGetProcAddress:Byte Ptr( fname$z )

This function returns the address of an OpenAL extension function.

ParametersDescription
fnamea null-terminated string containing the function name

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


Global alGetEnumValue( ename$z )

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

ParametersDescription
enamea null-terminated string describing an OpenAL enum

Returns the actual ALenum described by a string. Returns NULL if the string doesnt describe a valid OpenAL enum.


Global alListenerf( param,value# )

This function sets a floating point property for the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be set: AL_GAIN
valuethe ALfloat value to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alListener3f( param,value1#,value2#,value3# )

This function sets a floating point property for the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to set:
AL_POSITION
AL_VELOCITY
v1, v2, v3the value to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alListenerfv( param,values:Float Ptr )

This function sets a floating point-vector property of the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be set:
AL_POSITION
AL_VELOCITY
AL_ORIENTATION
valuespointer to floating point-vector values

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alListeneri( param,value )

This function sets an integer property of the listener.

ParametersDescription
paramthe name of the attribute to be set
valuethe integer value to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.

There are no integer listener attributes defined for OpenAL 1.1, but this function may be used by an extension.


Global alListener3i( param,value1,value2,value3 )

This function sets an integer property of the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be set:
AL_POSITION
AL_VELOCITY
value1, value2, value3the integer values to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alListeneriv( param,values:Int Ptr )

This function sets an integer property of the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be set:
AL_POSITION
AL_VELOCITY
AL_ORIENTATION
valuespointer to the integer values to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetListenerf( param,value:Float Ptr )

This function retrieves a floating point property of the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be retrieved: AL_GAIN
valuea pointer to the floating point value being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetListener3f( param,value1:Float Ptr,value2:Float Ptr,value3:Float Ptr )

This function retrieves a set of three floating point values from a property of the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be retrieved:
AL_POSITION
AL_VELOCITY
value1, value2, value3pointers to the three floating point being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetListenerfv( param,values:Float Ptr )

This function retrieves a floating point-vector property of the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be retrieved:
AL_POSITION
AL_VELOCITY
AL_ORIENTATION
valuesa pointer to the floating point-vector value being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetListeneri( param,value:Int Ptr )

This function retrieves an integer property of the listener.

ParametersDescription
paramthe name of the attribute to be retrieved
valuea pointer to the integer value being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.

There are no integer listener attributes defined for OpenAL 1.1, but this function may be used by an extension.


Global alGetListener3i( param,value1:Int Ptr,value2:Int Ptr,value3:Int Ptr )

This function retrieves an integer property of the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be retrieved:
AL_POSITION
AL_VELOCITY
value1, value2, value3pointers to the integer values being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetListeneriv( param,values:Int Ptr )

This function retrieves an integer property of the listener. The relevant properties are listed in the table Listener Properties.

ParametersDescription
paramthe name of the attribute to be retrieved:
AL_POSITION
AL_VELOCITY
AL_ORIENTATION
valuesa pointer to the integer values being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGenBuffers( n,buffers:Int Ptr )

This Function generates one or more buffers, which contain audio data (see alBufferData). References To buffers are ALuint values, which are used wherever a buffer reference is needed (in calls such as alDeleteBuffers, alSourcei, alSourceQueueBuffers, and alSourceUnqueueBuffers).

ParametersDescription
nthe number of buffers To be generated
bufferspointer To an array of ALuint values which will store the names of the New buffers

Possible Error StatesDescription
AL_INVALID_VALUEThe buffer array isn't large enough to hold the number of buffers requested.
AL_OUT_OF_MEMORYThere is not enough memory available To generate all the buffers requested.

If the requested number of buffers cannot be created, an error will be generated which can be detected with [alGetError](../../pub/pub.openal/#global-algeterror). If an error occurs, no buffers will be generated. If n equals zero, [alGenBuffers](../../pub/pub.openal/#global-algenbuffers-nbuffersint-ptr-) does nothing and does not Return an error.


Global alDeleteBuffers( n,buffers:Int Ptr )

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 alSourcei and alSourceUnqueueBuffers for information on how to detach a buffer from a source.

ParametersDescription
nthe number of buffers to be deleted
bufferspointer to an array of buffer names identifying the buffers to be deleted

Possible Error StatesDescription
AL_INVALID_OPERATIONThe buffer is still in use and can not be deleted.
AL_INVALID_NAMEA buffer name is invalid.
AL_INVALID_VALUEThe requested number of buffers can not be deleted.

If the requested number of buffers cannot be deleted, an error will be generated which can be detected with [alGetError](../../pub/pub.openal/#global-algeterror). If an error occurs, no buffers will be deleted. If n equals zero, [alDeleteBuffers](../../pub/pub.openal/#global-aldeletebuffers-nbuffersint-ptr-) does nothing and will not return an error.


Global alIsBuffer( bid )

This function tests if a buffer name is valid, returning AL_TRUE if valid, AL_FALSE if not.

ParametersDescription
bida buffer name to be tested for validity

The NULL buffer is always valid (see [alSourcei](../../pub/pub.openal/#global-alsourcei-sidparamvalue-) for information on how the NULL buffer is used).


Global alBufferData( bid,format,data:Byte Ptr,size,freq )

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

ParametersDescription
bidbuffer name to be filled with data
formatformat type from among the following: AL_FORMAT_MONO8, AL_FORMAT_MONO16, AL_FORMAT_STEREO8, AL_FORMAT_STEREO16
datapointer to the audio data
sizethe size of the audio data in bytes
freqthe frequency of the audio data

Possible Error StatesDescription
AL_OUT_OF_MEMORYThere is not enough memory available to create this buffer.
AL_INVALID_VALUEThe size parameter is not valid for the format specified, the buffer is in use, or the data is a NULL pointer.
AL_INVALID_ENUMThe specified format does not exist.

8-bit PCM data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero. 16-bit PCM data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Stereo data is expressed in interleaved format, left channel first. Buffers containing more than one channel of data will be played without 3D spatialization.


Global alBufferf( bid,param,value# )

This Function sets a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
paramthe name of the attribute To be set
valuethe ALfloat value To be set

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.

There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by this call, but this Function may be used by OpenAL extensions.


Global alBuffer3f( bid,param,value1#,value2#,value3# )

This function sets a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
paramthe name of the attribute to be set
value1, value2, value3the ALfloat values to be set

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.

There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by this call, but this function may be used by OpenAL extensions.


Global alBufferfv( bid,param,values:Float Ptr )

This function sets a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
paramthe name of the attribute to be set
valuesa pointer to the ALfloat values to be set

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.

There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by this call, but this function may be used by OpenAL extensions.


Global alBufferi( bid,param,value )

This Function sets a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
paramthe name of the attribute To be set
valuethe ALint value To be set

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.

There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by this call, but this Function may be used by OpenAL extensions.


Global alBuffer3i( bid,param,value1,value2,value3 )

This Function sets a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
paramthe name of the attribute To be set
value1, value2, value3the ALint values To be set

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.

There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by this call, but this Function may be used by OpenAL extensions.


Global alBufferiv( bid,param,values:Int Ptr )

This Function sets a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
paramthe name of the attribute To be set
valuesa pointer To the ALint values To be set

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.

There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by this call, but this Function may be used by OpenAL extensions.


Global alGetBufferf( bid,param,value:Float Ptr )

This Function retrieves a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
pnamethe name of the attribute To be retrieved
valuea pointer to an ALfloat To hold the retrieved data

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.
AL_INVALID_VALUEThe specified value pointer is not valid.

There are no relevant buffer properties defined in OpenAL 1.1 which can be retrieved by this call, but this Function may be used by OpenAL extensions.


Global alGetBuffer3f( bid,param,value1:Float Ptr,value2:Float Ptr,value3:Float Ptr )

This Function retrieves a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
pnamethe name of the attribute To be retrieved
value1, value2, value3pointers to a ALfloat values To hold the retrieved data

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.
AL_INVALID_VALUEThe specified value pointer is not valid.

There are no relevant buffer properties defined in OpenAL 1.1 which can be retrieved by this call, but this Function may be used by OpenAL extensions.


Global alGetBufferfv( bid,param,values:Float Ptr )

This Function retrieves a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
pnamethe name of the attribute to be retrieved
valuespointer To an ALfloat vector To hold the retrieved data

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.
AL_INVALID_VALUEThe specified value pointer is not valid.

There are no relevant buffer properties defined in OpenAL 1.1 which can be retrieved by this call, but this Function may be used by OpenAL extensions.


Global alGetBufferi( bid,param,value:Int Ptr )

This Function retrieves a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
pnamethe name of the attribute to be retrieved: AL_FREQUENCY, AL_BITS, AL_CHANNELS, AL_SIZE, AL_DATA
valuea pointer To an ALint To hold the retrieved data

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.
AL_INVALID_VALUEThe specified value pointer is not valid.

There are no relevant buffer properties defined in OpenAL 1.1 which can be retrieved by this call, but this Function may be used by OpenAL extensions.


Global alGetBuffer3i( bid,param,value1:Int Ptr,value2:Int Ptr,value3:Int Ptr )

This Function retrieves a floating point property of a buffer.

ParametersDescription
bidbuffer name whose attribute is being retrieved
pnamethe name of the attribute To be retrieved
value1, value2, value3pointers To ALint values To hold the retrieved data

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.
AL_INVALID_VALUEThe specified value pointer is not valid.

There are no relevant buffer properties defined in OpenAL 1.1 which can be retrieved by this call, but this Function may be used by OpenAL extensions.


Global alGetBufferiv( bid,param,values:Int Ptr )

This Function retrieves a floating point property of a buffer. The relevant properties are listed in the table Buffer Properties.

ParametersDescription
bidbuffer name whose attribute is being retrieved
pnamethe name of the attribute To be retrieved
valuespointer to an ALint vector To hold the retrieved data

Possible Error StatesDescription
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified buffer doesn't have parameters (the NULL buffer), or doesn't exist.
AL_INVALID_VALUEThe specified value pointer is not valid.

There are no relevant buffer properties defined in OpenAL 1.1 which can be retrieved by this call, but this function may be used by OpenAL extensions.


Global alGenSources( n,sources:Int Ptr )

This Function generates one or more sources. References To sources are ALuint values, which are used wherever a source reference is needed (in calls such as alDeleteSources and alSourcei).

ParametersDescription
nthe number of sources To be generated
sourcespointer To an array of ALuint values which will store the names of the New sources

Possible Error StatesDescription
AL_OUT_OF_MEMORYThere is not enough memory To generate all the requested sources.
AL_INVALID_VALUEThere are not enough non-memory resources To create all the requested sources, or the array pointer is not valid.
AL_INVALID_OPERATIONThere is no context To create sources in.

If the requested number of sources cannot be created, an error will be generated which can be detected with [alGetError](../../pub/pub.openal/#global-algeterror). If an error occurs, no sources will be generated. If n equals zero, [alGenSources](../../pub/pub.openal/#global-algensources-nsourcesint-ptr-) does nothing and does not Return an error.


Global alDeleteSources( n,sources:Int Ptr )

This function deletes one or more sources.

ParametersDescription
nthe number of sources to be deleted
sourcespointer to an array of source names identifying the sources to be deleted

Possible Error StatesDescription
AL_INVALID_NAMEat least one specified source is not valid, or an attempt is being made to delete more sources than exist.
AL_INVALID_OPERATIONThere is no current context.

If the requested number of sources cannot be deleted, an error will be generated which can be detected with [alGetError](../../pub/pub.openal/#global-algeterror). If an error occurs, no sources will be deleted. If n equals zero, [alDeleteSources](../../pub/pub.openal/#global-aldeletesources-nsourcesint-ptr-) does nothing and will not return an error.

A playing source can be deleted - the source will be stopped and then deleted.


Global alIsSource( sid )

This function tests if a source name is valid, returning AL_TRUE if valid and AL_FALSE if not.

ParametersDescription
sida source name to be tested for validity

Possible Error StatesDescription
AL_INVALID_OPERATIONThere is no current context.


Global alSourcef( sid,param,value# )

This function sets a floating point property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being set
paramthe name of the attribute to set:
AL_PITCH
AL_GAIN
AL_MAX_DISTANCE
AL_ROLLOFF_FACTOR
AL_REFERENCE_DISTANCE
AL_MIN_GAIN
AL_MAX_GAIN
AL_CONE_OUTER_GAIN
valuethe value to set the attribute t

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alSource3f( sid,param,value1#,value2#,value3# )

This function sets a source property requiring three floating point values. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being set
paramthe name of the attribute to set:
AL_POSITION
AL_VELOCITY
AL_DIRECTION
v1, v2, v3the three ALfloat values which the attribute will be set to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

This function is an alternative to alSourcefv.


Global alSourcefv( sid,param,values:Float Ptr )

This function sets a source property requiring three floating point values. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being set
paramthe name of the attribute to set:
AL_POSITION
AL_VELOCITY
AL_DIRECTION
valuesa pointer to the vector to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

This function is an alternative to alSource3f.


Global alSourcei( sid,param,value )

This function sets an integer property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being set
paramthe name of the attribute to set:
AL_SOURCE_RELATIVE
AL_CONE_INNER_ANGLE
AL_CONE_OUTER_ANGLE
AL_LOOPING
AL_BUFFER
AL_SOURCE_STATE
valuea pointer to the vector to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

The buffer name zero is reserved as a "NULL Buffer" and is accepted by alSourcei(..., AL_BUFFER, ...) as a valid buffer of zero length. The NULL Buffer is extremely useful for detaching buffers from a source which were attached using this call or with alSourceQueueBuffers.


Global alSource3i( sid,param,value1,value2,value3 )

This function sets an integer property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being set
paramthe name of the attribute to set:
AL_POSITION
AL_VELOCITY
AL_DIRECTION
value1, value2, value3the values to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alSourceiv( sid,param,values:Int Ptr )

This function sets an integer property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being set
paramthe name of the attribute to set:
AL_POSITION
AL_VELOCITY
AL_DIRECTION
valuesthe values to set the attribute to

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetSourcef( sid,param,value:Float Ptr )

This function retrieves a floating point property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being retrieved
paramthe name of the attribute to retrieve:
AL_PITCH
AL_GAIN
AL_MIN_GAIN
AL_MAX_GAIN
AL_MAX_DISTANCE
AL_ROLLOFF_FACTOR
AL_CONE_OUTER_GAIN
AL_CONE_INNER_ANGLE
AL_CONE_OUTER_ANGLE
AL_REFERENCE_DISTANCE
valuea pointer to the floating point value being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetSource3f( sid,param,value1:Float Ptr,value2:Float Ptr,value3:Float Ptr )

This function retrieves three floating point values representing a property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being retrieved
paramthe name of the attribute to retrieve:
AL_POSITION
AL_VELOCITY
AL_DIRECTION
value1,value2,value3pointers to the values to retrieve

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetSourcefv( sid,param,values:Float Ptr )

This function retrieves a floating point-vector property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being retrieved
paramthe name of the attribute to retrieve:
AL_POSITION
AL_VELOCITY
AL_DIRECTION
valuesa pointer to the vector to retrieve

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetSourcei( sid,param,value:Int Ptr )

This function retrieves an integer property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being retrieved
pnamethe name of the attribute to retrieve:
AL_SOURCE_RELATIVE
AL_BUFFER
AL_SOURCE_STATE
AL_BUFFERS_QUEUED
AL_BUFFERS_PROCESSED
valuea pointer to the integer value being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetSource3i( sid,param,value1:Int Ptr,value2:Int Ptr,value3:Int Ptr )

This function retrieves an integer property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being retrieved
pnamethe name of the attribute to retrieve:
AL_POSITION
AL_VELOCITY
AL_DIRECTION
value1, value2, value3pointers to the integer values being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alGetSourceiv( sid,param,values:Int Ptr )

This function retrieves an integer property of a source. The relevant properties are listed in the table Source Properties.

ParametersDescription
sidsource name whose attribute is being retrieved
pnamethe name of the attribute to retrieve:
AL_POSITION
AL_VELOCITY
AL_DIRECTION
valuespointers to the integer values being retrieved

Possible Error StatesDescription
AL_INVALID_VALUEThe value given is out of range.
AL_INVALID_ENUMThe specified parameter is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alSourcePlayv( ns,sids:Int Ptr )

This function plays a set of sources.

ParametersDescription
nsthe number of sources to be played
sidsa pointer to an array of sources to be played

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

The playing sources will have their state changed to AL_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 AL_STOPPED state.


Global alSourceStopv( ns,sids:Int Ptr )

This function stops a set of sources.

ParametersDescription
nsthe number of sources to stop
sidsa pointer to an array of sources to be stopped

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

The stopped sources will have their state changed to AL_STOPPED.


Global alSourceRewindv( ns,sids:Int Ptr )

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

ParametersDescription
nsthe number of sources to be rewound
sidsa pointer to an array of sources to be rewound

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alSourcePausev( ns,sids:Int Ptr )

This function pauses a set of sources.

ParametersDescription
nsthe number of sources to be paused
sidsa pointer to an array of sources to be paused

Possible Error StatesDescription
AL_INVALID_VALUEThe value pointer given is not valid.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

The paused sources will have their state changed to AL_PAUSED.


Global alSourcePlay( sid )

This function plays a source.

ParametersDescription
sidthe name of the source to be played

Possible Error StatesDescription
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

The playing source will have its state changed to AL_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 AL_STOPPED state.


Global alSourceStop( sid )

This function stops a source.

ParametersDescription
sidthe name of the source to be stopped

Possible Error StatesDescription
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

The stopped source will have its state changed to AL_STOPPED.


Global alSourceRewind( sid )

This function stops the source and sets its state to AL_INITIAL.

ParametersDescription
sidthe name of the source to be rewound

Possible Error StatesDescription
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.


Global alSourcePause( sid )

This function pauses a source.

ParametersDescription
sidthe name of the source to be paused

Possible Error StatesDescription
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

The paused source will have its state changed to AL_PAUSED.


Global alSourceQueueBuffers( sid,numEntries,bids:Int Ptr )

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 an alSourcei call to retrieve AL_BUFFERS_PROCESSED.

ParametersDescription
sidthe name of the source to queue buffers onto
numEntriesthe number of buffers to be queued
bidsa pointer to an array of buffer names to be queued

Possible Error StatesDescription
AL_INVALID_NAMEat least one specified buffer name is not valid, or the specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context, an attempt was made to add a new buffer which is not the same format as the buffers already in the queue, or the source already has a static buffer attached.

When first created, a source will be of type AL_UNDETERMINED. A successful [alSourceQueueBuffers](../../pub/pub.openal/#global-alsourcequeuebuffers-sidnumentriesbidsint-ptr-) call will change the source type to AL_STREAMING.


Global alSourceUnqueueBuffers( sid,numEntries,bids:Int Ptr )

This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using an alSourcei call to retrieve AL_BUFFERS_PROCESSED, which is the maximum number of buffers that can be unqueued using this call.

ParametersDescription
sidthe name of the source to unqueue buffers from
numEntriesthe number of buffers to be unqueued
bidsa pointer to an array of buffer names that were removed

Possible Error StatesDescription
AL_INVALID_VALUEat least one buffer can not be unqueued because it has not been processed yet.
AL_INVALID_NAMEThe specified source name is not valid.
AL_INVALID_OPERATIONThere is no current context.

The unqueue operation will only take place if all n buffers can be removed from the queue.


Global alDopplerFactor( value# )

This function selects the OpenAL Doppler factor value.

ParametersDescription
valuethe Doppler scale value to set

Possible Error StatesDescription
AL_INVALID_VALUEThe specified value is not valid.
AL_INVALID_OPERATIONThere is no current context.

The default Doppler factor value is 1.0.


Global alDopplerVelocity( value# )

This function selects the speed of sound for use in Doppler calculations.

ParametersDescription
valuethe speed of sound value to set

Possible Error StatesDescription
AL_INVALID_VALUEThe specified value is not valid.
AL_INVALID_OPERATIONThere is no current context.

The default speed of sound value is 343.3.


Global alSpeedOfSound( value# )

This function selects the speed of sound for use in Doppler calculations.

ParametersDescription
value#the speed of sound value to set

Possible Error StatesDescription
AL_INVALID_VALUEThe specified value is not valid.
AL_INVALID_OPERATIONThere is no current context.

The default speed of sound value is 343.3.


Global alDistanceModel( distanceModel )

This function selects the OpenAL distance model.

The AL_INVERSE_DISTANCE model works according to the following formula:

G_dB = AL_GAIN - 20log10(1 + AL_ROLLOFF_FACTOR(distance - AL_REFERENCE_DISTANCE)/AL_REFERENCE_DISTANCE));
G_dB = min(G_dB, AL_MAX_GAIN);
G_dB = max(G_dB, AL_MIN_GAIN);

The AL_INVERSE_DISTANCE_CLAMPED model works according to the following formula:

distance = max(distance, AL_REFERENCE_DISTANCE);
distance = min(distance, AL_MAX_DISTANCE);
G_dB = AL_GAIN - 20log10(1 + AL_ROLLOFF_FACTOR
(distance - AL_REFERENCE_DISTANCE)/AL_REFERENCE_DISTANCE));
G_dB = min(G_dB, AL_MAX_GAIN);
G_dB = max(G_dB, AL_MIN_GAIN);

The AL_NONE model works according to the following formula:

G_db = AL_GAIN;

ParametersDescription
distanceModelthe distance model to be set:
AL_NONE
AL_INVERSE_DISTANCE
AL_INVERSE_DISTANCE_CLAMPED

Possible Error StatesDescription
AL_INVALID_VALUEThe specified distance model is not valid.
AL_INVALID_OPERATIONThere is no current context.

The default distance model in OpenAL is AL_INVERSE_DISTANCE_CLAMPED.


← Pub.LuaPub.OpenGLES →
  • Functions
    • Function OpenALInstalled()
  • Globals
    • Global alcOpenDevice:Byte Ptr( devicename$z )
    • Global alcCloseDevice( device:Byte Ptr )
    • Global alcGetError( device:Byte Ptr )
    • Global alcGetString:Byte Ptr( device:Byte Ptr,param )
    • Global alcGetIntegerv( device:Byte Ptr,param,size,data:Int Ptr )
    • Global alcCreateContext:Byte Ptr( device:Byte Ptr,attrlist:Int Ptr )
    • Global alcMakeContextCurrent( context:Byte Ptr )
    • Global alcProcessContext( context:Byte Ptr )
    • Global alcSuspendContext( context:Byte Ptr )
    • Global alcDestroyContext( context:Byte Ptr )
    • Global alcGetCurrentContext:Byte Ptr()
    • Global alcGetContextsDevice:Byte Ptr( context:Byte Ptr )
    • Global alcIsExtensionPresent( device:Byte Ptr,extName$z )
    • Global alcGetProcAddress:Byte Ptr( device:Byte Ptr,funcName$z )
    • Global alcGetEnumValue( device:Byte Ptr,enumName$z )
    • Global alcCaptureOpenDevice:Byte Ptr( devicename$z,frequency,format,buffersize )
    • Global alcCaptureCloseDevice( device:Byte Ptr )
    • Global alcCaptureStart( device:Byte Ptr )
    • Global alcCaptureStop( device:Byte Ptr )
    • Global alcCaptureSamples( device:Byte Ptr,buffer:Byte Ptr,samples )
    • Global alEnable( capability )
    • Global alDisable( capability )
    • Global alIsEnabled( capability )
    • Global alGetString:Byte Ptr( param )
    • Global alGetBooleanv( param,data:Byte Ptr )
    • Global alGetIntegerv( param,data:Int Ptr )
    • Global alGetFloatv( param,data:Float Ptr )
    • Global alGetDoublev( param,data:Double Ptr )
    • Global alGetBoolean( param )
    • Global alGetInteger( param )
    • Global alGetFloat#( param )
    • Global alGetDouble!( param )
    • Global alGetError()
    • Global alIsExtensionPresent( extname$z )
    • Global alGetProcAddress:Byte Ptr( fname$z )
    • Global alGetEnumValue( ename$z )
    • Global alListenerf( param,value# )
    • Global alListener3f( param,value1#,value2#,value3# )
    • Global alListenerfv( param,values:Float Ptr )
    • Global alListeneri( param,value )
    • Global alListener3i( param,value1,value2,value3 )
    • Global alListeneriv( param,values:Int Ptr )
    • Global alGetListenerf( param,value:Float Ptr )
    • Global alGetListener3f( param,value1:Float Ptr,value2:Float Ptr,value3:Float Ptr )
    • Global alGetListenerfv( param,values:Float Ptr )
    • Global alGetListeneri( param,value:Int Ptr )
    • Global alGetListener3i( param,value1:Int Ptr,value2:Int Ptr,value3:Int Ptr )
    • Global alGetListeneriv( param,values:Int Ptr )
    • Global alGenBuffers( n,buffers:Int Ptr )
    • Global alDeleteBuffers( n,buffers:Int Ptr )
    • Global alIsBuffer( bid )
    • Global alBufferData( bid,format,data:Byte Ptr,size,freq )
    • Global alBufferf( bid,param,value# )
    • Global alBuffer3f( bid,param,value1#,value2#,value3# )
    • Global alBufferfv( bid,param,values:Float Ptr )
    • Global alBufferi( bid,param,value )
    • Global alBuffer3i( bid,param,value1,value2,value3 )
    • Global alBufferiv( bid,param,values:Int Ptr )
    • Global alGetBufferf( bid,param,value:Float Ptr )
    • Global alGetBuffer3f( bid,param,value1:Float Ptr,value2:Float Ptr,value3:Float Ptr )
    • Global alGetBufferfv( bid,param,values:Float Ptr )
    • Global alGetBufferi( bid,param,value:Int Ptr )
    • Global alGetBuffer3i( bid,param,value1:Int Ptr,value2:Int Ptr,value3:Int Ptr )
    • Global alGetBufferiv( bid,param,values:Int Ptr )
    • Global alGenSources( n,sources:Int Ptr )
    • Global alDeleteSources( n,sources:Int Ptr )
    • Global alIsSource( sid )
    • Global alSourcef( sid,param,value# )
    • Global alSource3f( sid,param,value1#,value2#,value3# )
    • Global alSourcefv( sid,param,values:Float Ptr )
    • Global alSourcei( sid,param,value )
    • Global alSource3i( sid,param,value1,value2,value3 )
    • Global alSourceiv( sid,param,values:Int Ptr )
    • Global alGetSourcef( sid,param,value:Float Ptr )
    • Global alGetSource3f( sid,param,value1:Float Ptr,value2:Float Ptr,value3:Float Ptr )
    • Global alGetSourcefv( sid,param,values:Float Ptr )
    • Global alGetSourcei( sid,param,value:Int Ptr )
    • Global alGetSource3i( sid,param,value1:Int Ptr,value2:Int Ptr,value3:Int Ptr )
    • Global alGetSourceiv( sid,param,values:Int Ptr )
    • Global alSourcePlayv( ns,sids:Int Ptr )
    • Global alSourceStopv( ns,sids:Int Ptr )
    • Global alSourceRewindv( ns,sids:Int Ptr )
    • Global alSourcePausev( ns,sids:Int Ptr )
    • Global alSourcePlay( sid )
    • Global alSourceStop( sid )
    • Global alSourceRewind( sid )
    • Global alSourcePause( sid )
    • Global alSourceQueueBuffers( sid,numEntries,bids:Int Ptr )
    • Global alSourceUnqueueBuffers( sid,numEntries,bids:Int Ptr )
    • Global alDopplerFactor( value# )
    • Global alDopplerVelocity( value# )
    • Global alSpeedOfSound( value# )
    • Global alDistanceModel( distanceModel )
BlitzMax
Docs
Getting StartedDownloadsAbout
Community
ResourcesSyntaxBomb Forums
More
GitHubStarChat on Discord
Copyright © 2022 Bruce A Henderson