Section Index


1. OpenAL || 2. Debugging || 3. String Manipulation || 4. Networking || 5. Console || 6. Device I/O || 7. File I/O
8. Packages || 9. Objects || 10. Event Scheduling || 11. Datablocks || 12. Video / Texturing || 13. Special || 14. Resource Management
15. Scene || 16. Containers and Raycasts || 17. Editors || 18. Build || 19. Time || 20. GUIs || 21. Math


Introduction
This quick reference guide was taken directly out of The Game Programmer's Guide to Torque by Edward Maurina. It's an outstanding resource - a must for anyone wanting to get serious about programming in Torque.

Contents

OpenAL Wrappers

The following functions are for the most part wrappers on OpenAL functions. Many of these functions use enumerated values. The following table includes the string equivalents to the OpenAL enums as well as information on flags associated with them:

ALEnum
OpenAL Enum (C++)
Flags

AL_CONE_INNER_ANGLE
AL_CONE_OUTER_ANGLE
AL_CONE_OUTER_GAIN
AL_DIRECTION
AL_EXTENSIONS
AL_GAIN_LINEAR
AL_GAIN
AL_LOOPING
AL_MAX_DISTANCE
AL_ORIENTATION
AL_PITCH
AL_POSITION
AL_REFERENCE_DISTANCE
AL_RENDERER
AL_VELOCITY
AL_VENDOR
AL_VERSION

AL_CONE_INNER_ANGLE
AL_CONE_OUTER_ANGLE
AL_CONE_OUTER_GAIN
AL_DIRECTION
AL_EXTENSIONS
AL_GAIN_LINEAR
AL_GAIN
AL_LOOPING
AL_MAX_DISTANCE
AL_ORIENTATION
AL_PITCH
AL_POSITION
AL_REFERENCE_DISTANCE
AL_RENDERER
AL_VELOCITY
AL_VENDOR
AL_VERSION

(Source-Get-Set-Int)
(Source-Get-Set-Int)
(Source-Get-Set-Float)
(Source-Get-Set-Float3)
(Context-Get)
(Source-Listener-Get-Set-Float)
(Source-Listener-Get-Set-Float)
(Source-Get-Set-Int)
(Source-Get-Set-Float)
(Listener-Set-Float6)
(Source-Get-Set-Float)
(Source-Listener-Get-Set-Float3)
(Source-Get-Set-Float)
(Context-Get)
(Source-Listener-Get-Set-Float3)
(Context-Get)
(Context-Get)



OpenAL Functions


alxGetChannelVolume( channelID )

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

Syntax
channelID
– An 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( ALEnum )

alGetListener3f( ALEnum )

alGetListeneri( ALEnum )

Purpose
Use the al*GetListener* function to get the current value of a listener parameter, as specified by ALEnum.

Syntax
ALEnum
– A 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).

Notes
Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of al*GetListener*.

See Also
alxGetSource*



alxGetSourcef( handle , ALEnum )

alxGetSourcei( handle , ALEnum )

alxGetSource3f( handle , ALEnum )

Purpose
Use the alxGetSource* function to get the current value of a source parameter, as specified by ALEnum.

Syntax
handle
– The ID (a non-negative integer) corresponding to a previously set up sound source.
ALEnum – A 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.

Notes
Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of alxGetSource*.

See Also
alxSource*, al*GetListener*



alxGetStreamDuration( handle )

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

Syntax
handle –
The 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( handle )

Purpose
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.

Syntax
handle –
The 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



alGetString( ALEnum )

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

Syntax
ALEnum
– A 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.



alxGetWaveLen( fileName )

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

Syntax
fileName
– A full path to legally formatted sound file.

Returns
Returns play-length of the WAV file specified by filename in milliseconds.

See Also
alxGetStreamDuration, alxGetStreamPosition



alListener3f( ALEnum , x , y , z)

alxListenerf( AlEnum , value )

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

Syntax
ALEnum –
A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
x,y,z – XYZ floating-point coordinates.
value – An ALEnum type specific value corresponding to the new value for this enumerated parameters.

Returns
No return value.

See Also
al*GetListener*, alxSource*



alxIsPlaying( handle )

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

Syntax
handle –
The 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



alxPlay( handle )

alxPlay( profile )

alxPlay( profile , x , y , z )

Purpose
Use the alxPlay function to start playing a sound specified by either a previously set up sound (handle), or a previously defined audio profile. For 3D sounds, you must specify a XYZ coordinate for the source to play at.

Syntax
handle –
The ID (a non-negative integer) corresponding to a previously set up sound source.
profile – The ID (a non-negative integer) corresponding to a previously set up audio profile.
x,y,z – XYZ floating-point coordinates.

Returns
Returns handle to playing sound, or 0 on failure.

See Also
alxIsPlaying, alxStop, alxStopAll



alxSetChannelVolume( channelD , volume )

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

Syntax
channelID
– An integer value, equal to or greater than 0, corresponsding to a valid audio channel.
volume – A 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



alxSourcef( handle , ALEnum , value )

alxSourcei( handle , ALEenum , value )

alxSource3f( handle , ALEnum , x , y , z )

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

Syntax
handle –
The ID (a non-negative integer) corresponding to a previously set up sound source.
ALEnum – A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.
value – An ALEnum type specific value corresponding to the new value for this enumerated parameters.
x,y,z – XYZ floating-point coordinates.

Returns
No return value.

See Also
alxGetSource*, al*Listener*



alxStop( handle )

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

Syntax
handle –
The ID (a non-negative integer) corresponding to a previously set up sound source.

Returns
No return value.

See Also
alxIsPlaying, alxPlay, alxStopAll



alxStopAll()

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

Returns
No return.

See Also
alxIsPlaying, alxPlay, alxStop



OpenALInitDriver()

Purpose
Use the OpenALInitDriver function to initialize the OpenAL driver.

Returns
Returns true on successful initialization, false otherwise.

Notes
This must be done before all other OpenAL operations.

See Also
OpenALShutdownDriver



OpenALShutdownDriver()

Purpose
Use the OpenALShutdownDriver function to stop/shut down the OpenAL driver.

Returns
No return value.

Notes
After this is called, you must restart the driver with OpenALInitDriver to execute any new sound operations.

See Also
OpenALInitDriver


alxCreateSource( profile )

alxCreateSource( profile, x, y, z )

alxCreateSource( description, filename )

alxCreateSource( description, filename, x, y, z )

Purpose

--Arthur Ogawa 07:06, 15 March 2007 (PST)No information at present. This console function is present in TGE as of version 1.5.

Returns

Integer


OpenALRegisterExtensions()

Purpose

--Arthur Ogawa 07:06, 15 March 2007 (PST)No information at present. This console function is present in TGE as of version 1.5.

Returns

No return value.


Section Index


1. OpenAL || 2. Debugging || 3. String Manipulation || 4. Networking || 5. Console || 6. Device I/O || 7. File I/O
8. Packages || 9. Objects || 10. Event Scheduling || 11. Datablocks || 12. Video / Texturing || 13. Special || 14. Resource Management
15. Scene || 16. Containers and Raycasts || 17. Editors || 18. Build || 19. Time || 20. GUIs || 21. Math