TorqueScript Reference
Functions

Functions

String alGetListener3f (ALEnum)
 
Integer alGetListeneri (ALEnum)
 
String alGetString (ALEnum)
 
void alListener3f (ALEnum, x, y, z)
 
Integer alxCreateSource (audio-assetId)
 
Integer alxGetAudioLength (audio-assetId)
 
Float alxGetChannelVolume (channelID)
 
Float alxGetListenerf (ALEnum)
 
String alxGetSource3f (handle, ALEnum)
 
Float alxGetSourcef (handle, ALEnum)
 
Integer alxGetSourcei (handle, ALEnum)
 
Float alxGetStreamDuration (handle)
 
Float alxGetStreamPosition (handle)
 
Boolean alxIsPlaying (handle)
 
void alxListenerf (AlEnum, value)
 
Boolean alxPause (handle)
 
Integer alxPlay (audio-assetId)
 
Boolean alxSetChannelVolume (channelD, volume)
 
void alxSource3f (handle, ALEnum, x, y, z)
 
void alxSourcef (handle, ALEnum, value)
 
void alxSourcei (handle, ALEnum, value)
 
void alxStop (handle)
 
void alxStopAll ()
 
void alxUnpause (handle)
 
Boolean OpenALInitDriver ()
 
void OpenALRegisterExtensions ()
 
void OpenALShutdownDriver ()
 

Detailed Description

Function Documentation

◆ alGetListener3f()

String alGetListener3f ( ALEnum  )

Use the al*GetListener* function to get the current value of a listener parameter, as specified by ALEnum. Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of al*GetListener*.

Parameters
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
Returns
Returns a float (alxGetListenerf), a vector of three floats (alGetListener3f), or an integer value respectively (alGetListeneri).
See also
alxGetSource*

◆ alGetListeneri()

Integer alGetListeneri ( ALEnum  )

Use the al*GetListener* function to get the current value of a listener parameter, as specified by ALEnum. Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of al*GetListener*.

Parameters
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
Returns
Returns a float (alxGetListenerf), a vector of three floats (alGetListener3f), or an integer value respectively (alGetListeneri).
See also
alxGetSource*

◆ alGetString()

String alGetString ( ALEnum  )

Use the alGetString function to get the string equivalent to the specified OpenAL enumerated value.

Parameters
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
Returns
Returns a string corresponding to the passed ALEnum

◆ alListener3f()

void alListener3f ( ALEnum  ,
,
,
 
)

Use the al*Listener* function to set a listener parameter(s) as specified by the OpenAL enumerated type ALEnum.

Parameters
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
x,y,zXYZ floating-point coordinates.
Returns
No return value.
See also
al*GetListener*, alxSource*

◆ alxCreateSource()

Integer alxCreateSource ( audio-  assetId)

Create a source from the specified asset Id.

Parameters
audio-assetIdThe asset Id to create the source from.
Returns
The handle of the created source or 0 on error.

◆ alxGetAudioLength()

Integer alxGetAudioLength ( audio-  assetId)

Use the alxGetAudioLength function to get the play-length of a specified resource sound file in milliseconds.

Parameters
audio-assetIdThe asset Id that specifies the audio file to check.
Returns
Returns play-length of the audio file specified by audio-assetId in milliseconds.
See also
alxGetStreamDuration, alxGetStreamPosition

◆ alxGetChannelVolume()

Float alxGetChannelVolume ( channelID  )

Use the alxGetChannelVolume function to get the volume setting for a specified channel.

Parameters
channelIDAn integer value, equal to or greater than 0, corresponding to a valid audio channel.
Returns
Returns volume [ 0.0, 1.0 ] for channel specified by channelID.
See also
alxSetChannelVolume

◆ alxGetListenerf()

Float alxGetListenerf ( ALEnum  )

Use the al*GetListener* function to get the current value of a listener parameter, as specified by ALEnum. Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of al*GetListener*.

Parameters
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
Returns
Returns a float (alxGetListenerf), a vector of three floats (alGetListener3f), or an integer value respectively (alGetListeneri).
See also
alxGetSource*

◆ alxGetSource3f()

String alxGetSource3f ( handle  ,
ALEnum   
)

Use the alxGetSource* function to get the current value of a source parameter, as specified by ALEnum. Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of alxGetSource*.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
ALEnumA string containing an OpenAL enumerated type name.
Returns
Returns current value of parameter specified by ALEnum for source identified by handle.
See also
alxSource*, al*GetListener*

◆ alxGetSourcef()

Float alxGetSourcef ( handle  ,
ALEnum   
)

Use the alxGetSource* function to get the current value of a source parameter, as specified by ALEnum. Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of alxGetSource*.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
Returns
Returns current value of parameter specified by ALEnum for source identified by handle.
See also
alxSource*, al*GetListener*

◆ alxGetSourcei()

Integer alxGetSourcei ( handle  ,
ALEnum   
)

Use the alxGetSource* function to get the current value of a source parameter, as specified by ALEnum. Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of alxGetSource*.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
Returns
Returns current value of parameter specified by ALEnum for source identified by handle.
See also
alxSource*, al*GetListener*

◆ alxGetStreamDuration()

Float alxGetStreamDuration ( handle  )

Use the alxGetStreamDuration function to determine the length of a previously set up sound in seconds.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
Returns
Returns -1 for invalid handle, and 0.0 to N.M for valid handle indicating length of scheduled sound in seconds.
See also
alxGetStreamPosition

◆ alxGetStreamPosition()

Float alxGetStreamPosition ( handle  )

Use the alxGetStreamPosition function to get the current play position for a playing sound. Note, this value is a percentage equivalent to the percent of the sound that as already played.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
Returns
Returns -1 for invalid handle, and 0.0 to 1.0 for valid handle indicating what percentage of the sound file has been played.
See also
alxGetStreamDuration

◆ alxIsPlaying()

Boolean alxIsPlaying ( handle  )

Use the alxIsPlaying function to determine if the sound associated with a previously set-up sound handle is playing or not.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
Returns
Returns 1 if specified handle is being played, 0 otherwise.
See also
alxPlay, alxStop, alxStopAll

◆ alxListenerf()

void alxListenerf ( AlEnum  ,
value   
)

Use the al*Listener* function to set a listener parameter(s) as specified by the OpenAL enumerated type ALEnum.

Parameters
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
valueAn ALEnum type specific value corresponding to the new value for this enumerated parameters.
Returns
No return value.
See also
al*GetListener*, alxSource*

◆ alxPause()

Boolean alxPause ( handle  )

Use the alxPause function to pause a currently playing sound as specified by handle.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
Returns
No return value.
See also
alxIsPlaying, alxPlay, alxStopAll

◆ alxPlay()

Integer alxPlay ( audio-  assetId)

Play the audio asset Id.

Parameters
audio-assetIdThe asset Id to play.
Returns
The handle to the playing audio asset Id or 0 on error.

◆ alxSetChannelVolume()

Boolean alxSetChannelVolume ( channelD  ,
volume   
)

Use the alxSetChannelVolume function to set a volume [ 0.0, 1.0 ] for the channel specified by channelID.

Parameters
channelIDAn integer value, equal to or greater than 0, corresponding to a valid audio channel.
volumeA value between 0.0 and 1.0 specifying the new volume for the specified channel.
Returns
Returns true on success and false on failure.
See also
alxGetChannelVolume

◆ alxSource3f()

void alxSource3f ( handle  ,
ALEnum  ,
,
,
 
)

Use the alxSource* function to set a source parameter(s) as specified by the OpenAL enumerated type ALEnum.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
x,y,zXYZ floating-point coordinates.
Returns
No return value.
See also
alxGetSource*, al*Listener*

◆ alxSourcef()

void alxSourcef ( handle  ,
ALEnum  ,
value   
)

Use the alxSource* function to set a source parameter(s) as specified by the OpenAL enumerated type ALEnum.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
valueAn ALEnum type specific value corresponding to the new value for this enumerated parameters.
Returns
No return value.
See also
alxGetSource*, al*Listener*

◆ alxSourcei()

void alxSourcei ( handle  ,
ALEnum  ,
value   
)

Use the alxSource* function to set a source parameter(s) as specified by the OpenAL enumerated type ALEnum.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
ALEnumA string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
valueAn ALEnum type specific value corresponding to the new value for this enumerated parameters.
Returns
No return value.
See also
alxGetSource*, al*Listener*

◆ alxStop()

void alxStop ( handle  )

Use the alxStop function to stop a currently playing sound as specified by handle.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
Returns
No return value.
See also
alxIsPlaying, alxPlay, alxStopAll

◆ alxStopAll()

void alxStopAll ( )

Use the alxStopAll function to stop all currently playing sounds associated with registered handles.

Returns
No return.
See also
alxIsPlaying, alxPlay, alxStop

◆ alxUnpause()

void alxUnpause ( handle  )

Use the alxUnpause function to resume playing a currently paused sound as specified by handle.

Parameters
handleThe ID (a non-negative integer) corresponding to a previously set up sound source.
Returns
No return value.
See also
alxIsPlaying, alxPlay, alxStopAll

◆ OpenALInitDriver()

Boolean OpenALInitDriver ( )

Use the OpenALInitDriver function to initialize the OpenAL driver. This must be done before all other OpenAL operations.

Returns
Returns true on successful initialization, false otherwise.
See also
OpenALShutdownDriver

◆ OpenALRegisterExtensions()

void OpenALRegisterExtensions ( )
Note
Currently does nothing (possibly deprecated)

◆ OpenALShutdownDriver()

void OpenALShutdownDriver ( )

Use the OpenALShutdownDriver function to stop/shut down the OpenAL driver. After this is called, you must restart the driver with OpenALInitDriver to execute any new sound operations.

Returns
No return value.
See also
OpenALInitDriver