Offers a VERY simple interface to play background music & sound effects. More...
#include <SimpleAudioEngine.h>
Public Member Functions | |
virtual void | preloadBackgroundMusic (const char *pszFilePath) |
Preload background music. More... | |
virtual void | playBackgroundMusic (const char *pszFilePath, bool bLoop=false) |
Play background music. More... | |
var | playMusic ( var pszFilePath, var false) |
Play background music. More... | |
local | playMusic ( local pszFilePath, local false) |
Play background music. More... | |
virtual void | stopBackgroundMusic (bool bReleaseData=false) |
Stop playing background music. More... | |
virtual void | pauseBackgroundMusic () |
Pause playing background music. More... | |
virtual void | resumeBackgroundMusic () |
Resume playing background music. More... | |
virtual void | rewindBackgroundMusic () |
Rewind playing background music. More... | |
virtual bool | willPlayBackgroundMusic () |
Indicates whether any background music can be played or not. More... | |
virtual bool | isBackgroundMusicPlaying () |
Indicates whether the background music is playing. More... | |
virtual float | getBackgroundMusicVolume () |
The volume of the background music within the range of 0.0 as the minimum and 1.0 as the maximum. More... | |
virtual void | setBackgroundMusicVolume (float volume) |
Set the volume of background music. More... | |
var | setMusicVolume ( var volume) |
Set the volume of background music. More... | |
local | setMusicVolume ( local volume) |
Set the volume of background music. More... | |
virtual float | getEffectsVolume () |
The volume of the effects within the range of 0.0 as the minimum and 1.0 as the maximum. More... | |
virtual void | setEffectsVolume (float volume) |
Set the volume of sound effects. More... | |
local | setEffectsVolume ( local volume) |
Set the volume of sound effects. More... | |
virtual unsigned int | playEffect (const char *pszFilePath, bool bLoop=false, float pitch=1.0f, float pan=0.0f, float gain=1.0f) |
Play sound effect with a file path, pitch, pan and gain. More... | |
virtual void | pauseEffect (unsigned int nSoundId) |
Pause playing sound effect. More... | |
virtual void | pauseAllEffects () |
Pause all playing sound effect. More... | |
virtual void | resumeEffect (unsigned int nSoundId) |
Resume playing sound effect. More... | |
local | resumeEffect ( local nSoundId) |
Resume playing sound effect. More... | |
virtual void | resumeAllEffects () |
Resume all playing sound effect. More... | |
virtual void | stopEffect (unsigned int nSoundId) |
Stop playing sound effect. More... | |
virtual void | stopAllEffects () |
Stop all playing sound effects. More... | |
virtual void | preloadEffect (const char *pszFilePath) |
preload a compressed audio file More... | |
local | preloadEffect ( local pszFilePath) |
preload a compressed audio file More... | |
virtual void | unloadEffect (const char *pszFilePath) |
unload the preloaded effect from internal buffer More... | |
Static Public Member Functions | |
static SimpleAudioEngine * | getInstance () |
Get the shared Engine object,it will new one when first time be called. More... | |
local | getInstance () |
Get the shared Engine object,it will new one when first time be called. More... | |
static SimpleAudioEngine * | sharedEngine () |
static void | end () |
Release the shared Engine object. More... | |
local | end () |
Release the shared Engine object. More... | |
Protected Member Functions | |
SimpleAudioEngine () | |
virtual | ~SimpleAudioEngine () |
Offers a VERY simple interface to play background music & sound effects.
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
static |
Release the shared Engine object.
|
static |
Release the shared Engine object.
|
static |
Release the shared Engine object.
|
virtual |
The volume of the background music within the range of 0.0 as the minimum and 1.0 as the maximum.
|
virtual |
The volume of the background music within the range of 0.0 as the minimum and 1.0 as the maximum.
|
virtual |
The volume of the background music within the range of 0.0 as the minimum and 1.0 as the maximum.
|
virtual |
The volume of the effects within the range of 0.0 as the minimum and 1.0 as the maximum.
|
virtual |
The volume of the effects within the range of 0.0 as the minimum and 1.0 as the maximum.
|
virtual |
The volume of the effects within the range of 0.0 as the minimum and 1.0 as the maximum.
|
static |
Get the shared Engine object,it will new one when first time be called.
|
static |
Get the shared Engine object,it will new one when first time be called.
|
static |
Get the shared Engine object,it will new one when first time be called.
|
virtual |
Indicates whether the background music is playing.
|
virtual |
Indicates whether the background music is playing.
|
virtual |
Indicates whether the background music is playing.
|
virtual |
Pause all playing sound effect.
|
virtual |
Pause all playing sound effect.
|
virtual |
Pause all playing sound effect.
|
virtual |
Pause playing background music.
|
virtual |
Pause playing background music.
|
virtual |
Pause playing background music.
|
virtual |
Pause playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
Pause playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
Pause playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
Play background music.
pszFilePath | The path of the background music file,or the FileName of T_SoundResInfo |
bLoop | Whether the background music loop or not |
|
virtual |
Play background music.
pszFilePath | The path of the background music file,or the FileName of T_SoundResInfo |
bLoop | Whether the background music loop or not |
|
virtual |
Play background music.
pszFilePath | The path of the background music file,or the FileName of T_SoundResInfo |
bLoop | Whether the background music loop or not |
|
virtual |
Play sound effect with a file path, pitch, pan and gain.
pszFilePath | The path of the effect file. |
bLoop | Determines whether to loop the effect playing or not. The default value is false. |
pitch | Frequency, normal value is 1.0. Will also change effect play time. |
pan | Stereo effect, in the range of [-1..1] where -1 enables only left channel. |
gain | Volume, in the range of [0..1]. The normal value is 1. |
|
virtual |
Play sound effect with a file path, pitch, pan and gain.
pszFilePath | The path of the effect file. |
bLoop | Determines whether to loop the effect playing or not. The default value is false. |
pitch | Frequency, normal value is 1.0. Will also change effect play time. |
pan | Stereo effect, in the range of [-1..1] where -1 enables only left channel. |
gain | Volume, in the range of [0..1]. The normal value is 1. |
|
virtual |
Play sound effect with a file path, pitch, pan and gain.
pszFilePath | The path of the effect file. |
bLoop | Determines whether to loop the effect playing or not. The default value is false. |
pitch | Frequency, normal value is 1.0. Will also change effect play time. |
pan | Stereo effect, in the range of [-1..1] where -1 enables only left channel. |
gain | Volume, in the range of [0..1]. The normal value is 1. |
|
virtual |
Preload background music.
pszFilePath | The path of the background music file. |
|
virtual |
Preload background music.
pszFilePath | The path of the background music file. |
|
virtual |
Preload background music.
pszFilePath | The path of the background music file. |
|
virtual |
preload a compressed audio file
the compressed audio will be decoded to wave, then written into an internal buffer in SimpleAudioEngine
pszFilePath | The path of the effect file |
|
virtual |
preload a compressed audio file
the compressed audio will be decoded to wave, then written into an internal buffer in SimpleAudioEngine
pszFilePath | The path of the effect file |
|
virtual |
preload a compressed audio file
the compressed audio will be decoded to wave, then written into an internal buffer in SimpleAudioEngine
pszFilePath | The path of the effect file |
|
virtual |
Resume all playing sound effect.
|
virtual |
Resume all playing sound effect.
|
virtual |
Resume all playing sound effect.
|
virtual |
Resume playing background music.
|
virtual |
Resume playing background music.
|
virtual |
Resume playing background music.
|
virtual |
Resume playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
Resume playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
Resume playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
Rewind playing background music.
|
virtual |
Rewind playing background music.
|
virtual |
Rewind playing background music.
|
virtual |
Set the volume of background music.
volume | must be within the range of 0.0 as the minimum and 1.0 as the maximum. |
|
virtual |
Set the volume of background music.
volume | must be within the range of 0.0 as the minimum and 1.0 as the maximum. |
|
virtual |
Set the volume of background music.
volume | must be within the range of 0.0 as the minimum and 1.0 as the maximum. |
|
virtual |
Set the volume of sound effects.
volume | must be within the range of 0.0 as the minimum and 1.0 as the maximum. |
|
virtual |
Set the volume of sound effects.
volume | must be within the range of 0.0 as the minimum and 1.0 as the maximum. |
|
virtual |
Set the volume of sound effects.
volume | must be within the range of 0.0 as the minimum and 1.0 as the maximum. |
|
inlinestatic |
|
virtual |
Stop all playing sound effects.
|
virtual |
Stop all playing sound effects.
|
virtual |
Stop all playing sound effects.
|
virtual |
Stop playing background music.
bReleaseData | If release the background music data or not.As default value is false |
|
virtual |
Stop playing background music.
bReleaseData | If release the background music data or not.As default value is false |
|
virtual |
Stop playing background music.
bReleaseData | If release the background music data or not.As default value is false |
|
virtual |
Stop playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
Stop playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
Stop playing sound effect.
nSoundId | The return value of function playEffect |
|
virtual |
unload the preloaded effect from internal buffer
pszFilePath | The path of the effect file |
|
virtual |
unload the preloaded effect from internal buffer
pszFilePath | The path of the effect file |
|
virtual |
unload the preloaded effect from internal buffer
pszFilePath | The path of the effect file |
|
virtual |
Indicates whether any background music can be played or not.
|
virtual |
Indicates whether any background music can be played or not.
|
virtual |
Indicates whether any background music can be played or not.