cocos2d-x 3.0
- 首页 - 相关页面 - 模块 - 命名空间 - - 文件 -
Public 成员函数 - 图1 Public 成员函数 - 图2)
- 类列表 - 类索引 - 类继承关系 - 类成员

全部)) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义)))

Public 成员函数 | 所有成员列表

AudioPlayer类 参考abstract

#include

类 AudioPlayer 继承关系图:

Public 成员函数 - 图3 FmodAudioPlayer

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

成员函数说明

virtual void close ( )

pure virtual

FmodAudioPlayer 内被实现.

virtual float getBackgroundMusicVolume ( )

pure virtual

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

FmodAudioPlayer 内被实现.

virtual float getEffectsVolume ( )

pure virtual

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

FmodAudioPlayer 内被实现.

virtual bool isBackgroundMusicPlaying ( )

pure virtual

Whether the background music is playing.

  • 返回
  • If is playing return true,or return false

FmodAudioPlayer 内被实现.

virtual void pauseAllEffects ( )

pure virtual

pause all playing effects

FmodAudioPlayer 内被实现.

virtual void pauseBackgroundMusic ( )

pure virtual

Pause playing background music.

FmodAudioPlayer 内被实现.

virtual void pauseEffect ( unsigned int uSoundId)

pure virtual

pause an effect identified by sound id

  • 参数
  • [in]uSoundIdsound id

FmodAudioPlayer 内被实现.

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

pure virtual

Play background music.

  • 参数
  • pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo bLoopWhether the background music loop or not

FmodAudioPlayer 内被实现.

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

pure virtual

Play sound effect.

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

FmodAudioPlayer 内被实现.

virtual void preloadBackgroundMusic ( const char * pszFilePath)

pure virtual

Preload background music.

  • 参数
  • pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo

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

FmodAudioPlayer 内被实现.

virtual void resumeAllEffects ( )

pure virtual

resume a effect identified by sound id

FmodAudioPlayer 内被实现.

virtual void resumeBackgroundMusic ( )

pure virtual

Resume playing background music.

FmodAudioPlayer 内被实现.

virtual void resumeEffect ( unsigned int uSoundId)

pure virtual

resume an effect identified by sound id

  • 参数
  • [in]uSoundIdsound id

FmodAudioPlayer 内被实现.

virtual void rewindBackgroundMusic ( )

pure virtual

Rewind playing background music.

FmodAudioPlayer 内被实现.

virtual void setBackgroundMusicVolume ( float volume)

pure virtual

set the volume of background music

  • 参数
  • volumemust be in 0.0~1.0

FmodAudioPlayer 内被实现.

virtual void setEffectsVolume ( float volume)

pure virtual

set the volume of sound effecs

  • 参数
  • volumemust be in 0.0~1.0

FmodAudioPlayer 内被实现.

virtual void stopAllEffects ( )

pure virtual

stop all playing effects

FmodAudioPlayer 内被实现.

virtual void stopBackgroundMusic ( bool bReleaseData = false)

pure virtual

Stop playing background music.

  • 参数
  • bReleaseDataIf release the background music data or not.As default value is false

FmodAudioPlayer 内被实现.

virtual void stopEffect ( unsigned int nSoundId)

pure virtual

Stop playing sound effect.

  • 参数
  • nSoundIdThe return value of function playEffect

FmodAudioPlayer 内被实现.

virtual void unloadEffect ( const char * pszFilePath)

pure virtual

unload the preloaded effect from internal buffer

  • 参数
  • [in]pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo

FmodAudioPlayer 内被实现.

virtual bool willPlayBackgroundMusic ( )

pure virtual

FmodAudioPlayer 内被实现.


该类的文档由以下文件生成:

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/audio/linux/AudioPlayer.h