Torque2D Reference
|
Classes | |
class | BackgroundTrackMgr |
class | OpenALThread |
class | SoundEngineEffect |
Typedefs | |
typedef ALvoid AL_APIENTRY(* | alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) |
typedef ALvoid AL_APIENTRY(* | alcMacOSXMixerOutputRateProcPtr) (const ALdouble value) |
Enumerations | |
enum | { kSoundEngineErrUnitialized = 1, kSoundEngineErrInvalidID = 2, kSoundEngineErrFileNotFound = 3, kSoundEngineErrInvalidFileFormat = 4, kSoundEngineErrDeviceNotFound = 5 } |
Functions | |
OSStatus | SoundEngine_Initialize (Float32 inMixerOutputRate) |
OSStatus | SoundEngine_Teardown () |
OSStatus | SoundEngine_SetMasterVolume (Float32 inValue) |
OSStatus | SoundEngine_SetListenerPosition (Float32 inX, Float32 inY, Float32 inZ) |
OSStatus | SoundEngine_SetListenerGain (Float32 inValue) |
OSStatus | SoundEngine_LoadBackgroundMusicTrack (const char *inPath, Boolean inAddToQueue, Boolean inLoadAtOnce) |
OSStatus | SoundEngine_UnloadBackgroundMusicTrack () |
OSStatus | SoundEngine_StartBackgroundMusic () |
OSStatus | SoundEngine_StopBackgroundMusic (Boolean inStopAtEnd) |
OSStatus | SoundEngine_SetBackgroundMusicVolume (Float32 inValue) |
bool | LoadSoundFile (const char *inFilePath, UInt32 *outEffectID) |
ALvoid | alBufferDataStaticProc (const ALint bid, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) |
ALvoid | alcMacOSXMixerOutputRateProc (const ALdouble value) |
OSStatus | OpenFile (const char *inFilePath, AudioFileID &outAFID) |
OSStatus | LoadFileDataInfo (const char *inFilePath, AudioFileID &outAFID, AudioStreamBasicDescription &outFormat, UInt64 &outDataSize) |
void | CalculateBytesForTime (AudioStreamBasicDescription &inDesc, UInt32 inMaxPacketSize, Float64 inSeconds, UInt32 *outBufferSize, UInt32 *outNumPackets) |
Boolean | FormatIsEqual (AudioStreamBasicDescription x, AudioStreamBasicDescription y) |
typedef ALvoid AL_APIENTRY(* alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) |
typedef ALvoid AL_APIENTRY(* alcMacOSXMixerOutputRateProcPtr) (const ALdouble value) |
anonymous enum |
ALvoid SoundEngine::alBufferDataStaticProc | ( | const ALint | bid, |
ALenum | format, | ||
ALvoid * | data, | ||
ALsizei | size, | ||
ALsizei | freq | ||
) |
ALvoid SoundEngine::alcMacOSXMixerOutputRateProc | ( | const ALdouble | value | ) |
void SoundEngine::CalculateBytesForTime | ( | AudioStreamBasicDescription & | inDesc, |
UInt32 | inMaxPacketSize, | ||
Float64 | inSeconds, | ||
UInt32 * | outBufferSize, | ||
UInt32 * | outNumPackets | ||
) |
Boolean SoundEngine::FormatIsEqual | ( | AudioStreamBasicDescription | x, |
AudioStreamBasicDescription | y | ||
) |
OSStatus SoundEngine::LoadFileDataInfo | ( | const char * | inFilePath, |
AudioFileID & | outAFID, | ||
AudioStreamBasicDescription & | outFormat, | ||
UInt64 & | outDataSize | ||
) |
bool SoundEngine::LoadSoundFile | ( | const char * | inFilePath, |
UInt32 * | outEffectID | ||
) |
OSStatus SoundEngine::OpenFile | ( | const char * | inFilePath, |
AudioFileID & | outAFID | ||
) |
OSStatus SoundEngine::SoundEngine_Initialize | ( | Float32 | inMixerOutputRate | ) |
SoundEngine_Initialize Initializes and sets up the sound engine. Calling after a previous initialize will reset the state of the SoundEngine, with all previous effects and music tracks erased. Note: This is not required, loading an effect or background track will initialize as necessary.
inMixerOutputRate | & nbsp; A Float32 that represents the output sample rate of the mixer unit. Setting this to 0 will use the default rate (the sample rate of the device) |
OSStatus SoundEngine::SoundEngine_LoadBackgroundMusicTrack | ( | const char * | inPath, |
Boolean | inAddToQueue, | ||
Boolean | inLoadAtOnce | ||
) |
SoundEngine_LoadBackgroundMusicTrack Tells the background music player which file to play
inPath | & nbsp; The absolute path to the file to play. |
inAddToQueue | & nbsp; If true, file will be added to the current background music queue. If false, queue will be cleared and only loop the specified file. |
inLoadAtOnce | & nbsp; If true, file will be loaded completely into memory. If false, data will be streamed from the file as needed. For games without large memory pressure and/or small background music files, this can save memory access and improve power efficiency |
OSStatus SoundEngine::SoundEngine_SetBackgroundMusicVolume | ( | Float32 | inValue | ) |
SoundEngine_SetBackgroundMusicVolume Sets the volume for the background music player
inValue | & nbsp; A Float32 that represents the level. The range is between 0.0 and 1.0 (inclusive). |
OSStatus SoundEngine::SoundEngine_SetListenerGain | ( | Float32 | inValue | ) |
SoundEngine_SetListenerGain Sets the gain of the listener. Must be >= 0.0
inValue | & nbsp; A Float32 that represents the listener's gain |
OSStatus SoundEngine::SoundEngine_SetListenerPosition | ( | Float32 | inX, |
Float32 | inY, | ||
Float32 | inZ | ||
) |
SoundEngine_SetListenerPosition Sets the position of the listener in the 3D space
inX | & nbsp; A Float32 that represents the listener's position along the X axis. |
inY | & nbsp; A Float32 that represents the listener's position along the Y axis. |
inZ | & nbsp; A Float32 that represents the listener's position along the Z axis. |
OSStatus SoundEngine::SoundEngine_SetMasterVolume | ( | Float32 | inValue | ) |
SoundEngine_SetMasterVolume Sets the overall volume of all sounds coming from the process
inValue | & nbsp; A Float32 that represents the level. The range is between 0.0 and 1.0 (inclusive). |
OSStatus SoundEngine::SoundEngine_StartBackgroundMusic | ( | ) |
SoundEngine_StartBackgroundMusic Tells the background music player to start playing.
OSStatus SoundEngine::SoundEngine_StopBackgroundMusic | ( | Boolean | inStopAtEnd | ) |
SoundEngine_StopBackgroundMusic Tells the background music player to stop playing.
inAddToQueue | & nbsp; If true, playback will stop when all tracks have completed. If false, playback will stop immediately. |
OSStatus SoundEngine::SoundEngine_Teardown | ( | ) |
SoundEngine_Teardown Tearsdown the sound engine.
OSStatus SoundEngine::SoundEngine_UnloadBackgroundMusicTrack | ( | ) |
SoundEngine_UnloadBackgroundMusicTrack Tells the background music player to release all resources and stop playing.