Torque2D Reference
Loading...
Searching...
No Matches
Audio Namespace Reference

Classes

struct  Description

Enumerations

enum  Constants { AudioVolumeChannels = 32 , AudioPreviewChannel = AudioVolumeChannels - 1 }

Functions

F32 DBToLinear (F32 value)
F32 linearToDB (F32 value)
void shutdownContext ()
bool OpenALIsInitialized ()
bool OpenALInit ()
void OpenALShutdown ()
bool OpenALDLLInit ()
void OpenALDLLShutdown ()
void initOpenAL ()
void shutdownOpenAL ()
void destroy ()

Variables

const int logmax = sizeof logtab / sizeof *logtab

Enumeration Type Documentation

◆ Constants

enum Constants
Enumerator
AudioVolumeChannels 
AudioPreviewChannel 

The channel an editor auditions an asset on.

Reserved so a preview cannot be silenced by, or interfere with, the running game's mix: a game that has turned its music channel down to nothing would otherwise make the Asset Manager unable to play a music asset at all, because alxCreateSource refuses to build a source on a muted channel rather than building a quiet one.

The last channel rather than the first free one, because channel numbering is a per-game convention with no engine meaning and games count up from zero.

Function Documentation

◆ DBToLinear()

F32 DBToLinear ( F32 value)

◆ destroy()

void destroy ( )

◆ initOpenAL()

void initOpenAL ( )

◆ linearToDB()

F32 linearToDB ( F32 value)

◆ OpenALDLLInit()

bool OpenALDLLInit ( )

The MacOS X build links against the OpenAL framework. It can be built to use either an internal framework, or the system framework. Since OpenAL is weak-linked in at compile time, we don't need to init anything. Stub it out...

◆ OpenALDLLShutdown()

void OpenALDLLShutdown ( )

Stubbed out, see the note on OpenALDLLInit().

◆ OpenALInit()

bool OpenALInit ( )

◆ OpenALIsInitialized()

bool OpenALIsInitialized ( )

Whether there is a live OpenAL context.

OpenALInit begins by shutting the driver down, so calling it a second time is destructive: it drops every playing source and resets the channel volumes. Anything that wants to start the driver only if nobody else has – an editor, say – has to be able to ask first.

◆ OpenALShutdown()

void OpenALShutdown ( )

◆ shutdownContext()

void shutdownContext ( )

◆ shutdownOpenAL()

void shutdownOpenAL ( )

Variable Documentation

◆ logmax

const int logmax = sizeof logtab / sizeof *logtab