cocos2d-x  3.0
 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
local close ()
virtual void preloadBackgroundMusic (const char *pszFilePath)=0
 Preload background music. More...
 
virtual void playBackgroundMusic (const char *pszFilePath, bool bLoop=false)=0
 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...
 
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
virtual bool isBackgroundMusicPlaying ()=0
 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...
 
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...
 
virtual unsigned int playEffect (const char *pszFilePath, bool bLoop, float pitch, float pan, float gain)=0
 Play sound effect. More...
 
virtual void stopEffect (unsigned int nSoundId)=0
 Stop playing sound effect. More...
 
virtual void preloadEffect (const char *pszFilePath)=0
 preload a compressed audio file More...
 
var preloadEffect ( var pszFilePath)
 preload a compressed audio file More...
 
local preloadEffect ( local pszFilePath)
 preload a compressed audio file More...
 
virtual void unloadEffect (const char *pszFilePath)=0
 unload the preloaded effect from internal buffer More...
 
var unloadEffect ( var pszFilePath)
 unload the preloaded effect from internal buffer More...
 
local unloadEffect ( local pszFilePath)
 unload the preloaded effect from internal buffer More...
 
virtual void pauseEffect (unsigned int uSoundId)=0
 pause an effect identified by sound id More...
 
var pauseEffect ( var uSoundId)
 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...
 
virtual void resumeEffect (unsigned int uSoundId)=0
 resume an effect identified by sound id More...
 
local resumeEffect ( local uSoundId)
 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...
 

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: