cocos2d-x  3.1rc0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AudioPlayer Class Referenceabstract

#include <AudioPlayer.h>

Inheritance diagram for AudioPlayer:
FmodAudioPlayer

Public Member Functions

virtual void close ()=0
var close ()
local close ()
virtual void preloadBackgroundMusic (const char *pszFilePath)=0
 Preload background music. More...
 
local preloadBackgroundMusic ( local pszFilePath)
 Preload background music. More...
 
virtual void playBackgroundMusic (const char *pszFilePath, bool bLoop=false)=0
 Play background music. More...
 
local playBackgroundMusic ( local pszFilePath, local false)
 Play background music. More...
 
virtual void stopBackgroundMusic (bool bReleaseData=false)=0
 Stop playing background music. More...
 
local stopBackgroundMusic ( local false)
 Stop playing background music. More...
 
virtual void pauseBackgroundMusic ()=0
 Pause playing background music. More...
 
var pauseBackgroundMusic ()
 Pause playing background music. More...
 
local pauseBackgroundMusic ()
 Pause playing background music. More...
 
virtual void resumeBackgroundMusic ()=0
 Resume playing background music. More...
 
var resumeBackgroundMusic ()
 Resume playing background music. More...
 
local resumeBackgroundMusic ()
 Resume playing background music. More...
 
virtual void rewindBackgroundMusic ()=0
 Rewind playing background music. More...
 
var rewindBackgroundMusic ()
 Rewind playing background music. More...
 
local rewindBackgroundMusic ()
 Rewind playing background music. More...
 
virtual bool willPlayBackgroundMusic ()=0
var willPlayBackgroundMusic ()
local willPlayBackgroundMusic ()
virtual bool isBackgroundMusicPlaying ()=0
 Whether the background music is playing. More...
 
var isBackgroundMusicPlaying ()
 Whether the background music is playing. More...
 
local isBackgroundMusicPlaying ()
 Whether the background music is playing. More...
 
virtual float getBackgroundMusicVolume ()=0
 The volume of the background music max value is 1.0,the min value is 0.0. More...
 
var getBackgroundMusicVolume ()
 The volume of the background music max value is 1.0,the min value is 0.0. More...
 
local getBackgroundMusicVolume ()
 The volume of the background music max value is 1.0,the min value is 0.0. More...
 
virtual void setBackgroundMusicVolume (float volume)=0
 set the volume of background music More...
 
local setBackgroundMusicVolume ( local volume)
 set the volume of background music More...
 
virtual float getEffectsVolume ()=0
 The volume of the effects max value is 1.0,the min value is 0.0. More...
 
virtual void setEffectsVolume (float volume)=0
 set the volume of sound effecs More...
 
var setEffectsVolume ( var volume)
 set the volume of sound effecs More...
 
local setEffectsVolume ( local volume)
 set the volume of sound effecs More...
 
virtual unsigned int playEffect (const char *pszFilePath, bool bLoop, float pitch, float pan, float gain)=0
 Play sound effect. More...
 
local playEffect ( local pszFilePath, local bLoop, local pitch, local pan, local gain)
 Play sound effect. More...
 
virtual void stopEffect (unsigned int nSoundId)=0
 Stop playing sound effect. More...
 
var stopEffect ( var nSoundId)
 Stop playing sound effect. More...
 
local stopEffect ( local nSoundId)
 Stop playing sound effect. More...
 
virtual void preloadEffect (const char *pszFilePath)=0
 preload a compressed audio file More...
 
virtual void unloadEffect (const char *pszFilePath)=0
 unload the preloaded effect from internal buffer More...
 
virtual void pauseEffect (unsigned int uSoundId)=0
 pause an effect identified by sound id More...
 
local pauseEffect ( local uSoundId)
 pause an effect identified by sound id More...
 
virtual void pauseAllEffects ()=0
 pause all playing effects More...
 
var pauseAllEffects ()
 pause all playing effects More...
 
local pauseAllEffects ()
 pause all playing effects More...
 
virtual void resumeEffect (unsigned int uSoundId)=0
 resume an effect identified by sound id More...
 
virtual void resumeAllEffects ()=0
 resume a effect identified by sound id More...
 
var resumeAllEffects ()
 resume a effect identified by sound id More...
 
local resumeAllEffects ()
 resume a effect identified by sound id More...
 
virtual void stopAllEffects ()=0
 stop all playing effects More...
 
var stopAllEffects ()
 stop all playing effects More...
 
local stopAllEffects ()
 stop all playing effects More...
 

Member Function Documentation

virtual void close ( )
pure virtual

Implemented in FmodAudioPlayer.

var close ( )
pure virtual

Implemented in FmodAudioPlayer.

local close ( )
pure virtual

Implemented in FmodAudioPlayer.

virtual float
getBackgroundMusicVolume
( )
pure virtual

The volume of the background music max value is 1.0,the min value is 0.0.

Implemented in FmodAudioPlayer.

var getBackgroundMusicVolume ( )
pure virtual

The volume of the background music max value is 1.0,the min value is 0.0.

Implemented in FmodAudioPlayer.

local getBackgroundMusicVolume ( )
pure virtual

The volume of the background music max value is 1.0,the min value is 0.0.

Implemented in FmodAudioPlayer.

virtual float getEffectsVolume ( )
pure virtual

The volume of the effects max value is 1.0,the min value is 0.0.

Implemented in FmodAudioPlayer.

var getEffectsVolume ( )
pure virtual

The volume of the effects max value is 1.0,the min value is 0.0.

Implemented in FmodAudioPlayer.

local getEffectsVolume ( )
pure virtual

The volume of the effects max value is 1.0,the min value is 0.0.

Implemented in FmodAudioPlayer.

virtual bool
isBackgroundMusicPlaying
( )
pure virtual

Whether the background music is playing.

Returns
If is playing return true,or return false

Implemented in FmodAudioPlayer.

var isBackgroundMusicPlaying ( )
pure virtual

Whether the background music is playing.

Returns
If is playing return true,or return false

Implemented in FmodAudioPlayer.

local isBackgroundMusicPlaying ( )
pure virtual

Whether the background music is playing.

Returns
If is playing return true,or return false

Implemented in FmodAudioPlayer.

virtual void pauseAllEffects ( )
pure virtual

pause all playing effects

Implemented in FmodAudioPlayer.

var pauseAllEffects ( )
pure virtual

pause all playing effects

Implemented in FmodAudioPlayer.

local pauseAllEffects ( )
pure virtual

pause all playing effects

Implemented in FmodAudioPlayer.

virtual void pauseBackgroundMusic ( )
pure virtual

Pause playing background music.

Implemented in FmodAudioPlayer.

var pauseBackgroundMusic ( )
pure virtual

Pause playing background music.

Implemented in FmodAudioPlayer.

local pauseBackgroundMusic ( )
pure virtual

Pause playing background music.

Implemented in FmodAudioPlayer.

virtual void pauseEffect ( unsigned int  uSoundId)
pure virtual

pause an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implemented in FmodAudioPlayer.

var pauseEffect ( var  uSoundId)
pure virtual

pause an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implemented in FmodAudioPlayer.

local pauseEffect ( local  uSoundId)
pure virtual

pause an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implemented in FmodAudioPlayer.

virtual void playBackgroundMusic ( const char *  pszFilePath,
bool  bLoop = false 
)
pure virtual

Play background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo
bLoopWhether the background music loop or not

Implemented in FmodAudioPlayer.

var playBackgroundMusic ( var  pszFilePath,
var  bLoop = false 
)
pure virtual

Play background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo
bLoopWhether the background music loop or not

Implemented in FmodAudioPlayer.

local playBackgroundMusic ( local  pszFilePath,
local  bLoop = false 
)
pure virtual

Play background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo
bLoopWhether the background music loop or not

Implemented in FmodAudioPlayer.

virtual unsigned int playEffect ( const char *  pszFilePath,
bool  bLoop,
float  pitch,
float  pan,
float  gain 
)
pure virtual

Play sound effect.

Parameters
pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo Whether to loop the effect playing, default value is false

Implemented in FmodAudioPlayer.

var playEffect ( var  pszFilePath,
var  bLoop,
var  pitch,
var  pan,
var  gain 
)
pure virtual

Play sound effect.

Parameters
pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo Whether to loop the effect playing, default value is false

Implemented in FmodAudioPlayer.

local playEffect ( local  pszFilePath,
local  bLoop,
local  pitch,
local  pan,
local  gain 
)
pure virtual

Play sound effect.

Parameters
pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo Whether to loop the effect playing, default value is false

Implemented in FmodAudioPlayer.

virtual void preloadBackgroundMusic ( const char *  pszFilePath)
pure virtual

Preload background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo

Implemented in FmodAudioPlayer.

var preloadBackgroundMusic ( var  pszFilePath)
pure virtual

Preload background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo

Implemented in FmodAudioPlayer.

local preloadBackgroundMusic ( local  pszFilePath)
pure virtual

Preload background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo

Implemented in FmodAudioPlayer.

virtual void preloadEffect ( const char *  pszFilePath)
pure virtual

preload a compressed audio file

the compressed audio will be decode to wave, then write into an internal buffer in SimpleaudioEngine

Implemented in FmodAudioPlayer.

var preloadEffect ( var  pszFilePath)
pure virtual

preload a compressed audio file

the compressed audio will be decode to wave, then write into an internal buffer in SimpleaudioEngine

Implemented in FmodAudioPlayer.

local preloadEffect ( local  pszFilePath)
pure virtual

preload a compressed audio file

the compressed audio will be decode to wave, then write into an internal buffer in SimpleaudioEngine

Implemented in FmodAudioPlayer.

virtual void resumeAllEffects ( )
pure virtual

resume a effect identified by sound id

Implemented in FmodAudioPlayer.

var resumeAllEffects ( )
pure virtual

resume a effect identified by sound id

Implemented in FmodAudioPlayer.

local resumeAllEffects ( )
pure virtual

resume a effect identified by sound id

Implemented in FmodAudioPlayer.

virtual void resumeBackgroundMusic ( )
pure virtual

Resume playing background music.

Implemented in FmodAudioPlayer.

var resumeBackgroundMusic ( )
pure virtual

Resume playing background music.

Implemented in FmodAudioPlayer.

local resumeBackgroundMusic ( )
pure virtual

Resume playing background music.

Implemented in FmodAudioPlayer.

virtual void resumeEffect ( unsigned int  uSoundId)
pure virtual

resume an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implemented in FmodAudioPlayer.

var resumeEffect ( var  uSoundId)
pure virtual

resume an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implemented in FmodAudioPlayer.

local resumeEffect ( local  uSoundId)
pure virtual

resume an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implemented in FmodAudioPlayer.

virtual void rewindBackgroundMusic ( )
pure virtual

Rewind playing background music.

Implemented in FmodAudioPlayer.

var rewindBackgroundMusic ( )
pure virtual

Rewind playing background music.

Implemented in FmodAudioPlayer.

local rewindBackgroundMusic ( )
pure virtual

Rewind playing background music.

Implemented in FmodAudioPlayer.

virtual void
setBackgroundMusicVolume
( float  volume)
pure virtual

set the volume of background music

Parameters
volumemust be in 0.0~1.0

Implemented in FmodAudioPlayer.

var setBackgroundMusicVolume ( var  volume)
pure virtual

set the volume of background music

Parameters
volumemust be in 0.0~1.0

Implemented in FmodAudioPlayer.

local setBackgroundMusicVolume ( local  volume)
pure virtual

set the volume of background music

Parameters
volumemust be in 0.0~1.0

Implemented in FmodAudioPlayer.

virtual void setEffectsVolume ( float  volume)
pure virtual

set the volume of sound effecs

Parameters
volumemust be in 0.0~1.0

Implemented in FmodAudioPlayer.

var setEffectsVolume ( var  volume)
pure virtual

set the volume of sound effecs

Parameters
volumemust be in 0.0~1.0

Implemented in FmodAudioPlayer.

local setEffectsVolume ( local  volume)
pure virtual

set the volume of sound effecs

Parameters
volumemust be in 0.0~1.0

Implemented in FmodAudioPlayer.

virtual void stopAllEffects ( )
pure virtual

stop all playing effects

Implemented in FmodAudioPlayer.

var stopAllEffects ( )
pure virtual

stop all playing effects

Implemented in FmodAudioPlayer.

local stopAllEffects ( )
pure virtual

stop all playing effects

Implemented in FmodAudioPlayer.

virtual void stopBackgroundMusic ( bool  bReleaseData = false)
pure virtual

Stop playing background music.

Parameters
bReleaseDataIf release the background music data or not.As default value is false

Implemented in FmodAudioPlayer.

var stopBackgroundMusic ( var  bReleaseData = false)
pure virtual

Stop playing background music.

Parameters
bReleaseDataIf release the background music data or not.As default value is false

Implemented in FmodAudioPlayer.

local stopBackgroundMusic ( local  bReleaseData = false)
pure virtual

Stop playing background music.

Parameters
bReleaseDataIf release the background music data or not.As default value is false

Implemented in FmodAudioPlayer.

virtual void stopEffect ( unsigned int  nSoundId)
pure virtual

Stop playing sound effect.

Parameters
nSoundIdThe return value of function playEffect

Implemented in FmodAudioPlayer.

var stopEffect ( var  nSoundId)
pure virtual

Stop playing sound effect.

Parameters
nSoundIdThe return value of function playEffect

Implemented in FmodAudioPlayer.

local stopEffect ( local  nSoundId)
pure virtual

Stop playing sound effect.

Parameters
nSoundIdThe return value of function playEffect

Implemented in FmodAudioPlayer.

virtual void unloadEffect ( const char *  pszFilePath)
pure virtual

unload the preloaded effect from internal buffer

Parameters
[in]pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo

Implemented in FmodAudioPlayer.

var unloadEffect ( var  pszFilePath)
pure virtual

unload the preloaded effect from internal buffer

Parameters
[in]pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo

Implemented in FmodAudioPlayer.

local unloadEffect ( local  pszFilePath)
pure virtual

unload the preloaded effect from internal buffer

Parameters
[in]pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo

Implemented in FmodAudioPlayer.

virtual bool
willPlayBackgroundMusic
( )
pure virtual

Implemented in FmodAudioPlayer.

var willPlayBackgroundMusic ( )
pure virtual

Implemented in FmodAudioPlayer.

local willPlayBackgroundMusic ( )
pure virtual

Implemented in FmodAudioPlayer.


The documentation for this class was generated from the following file: