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

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

Instance Methods | Class Methods | Protected 属性 | 属性 | 所有成员列表

SimpleAudioEngine类 参考

A wrapper to the CDAudioManager object. 更多…

#import

类 SimpleAudioEngine 继承关系图:

Instance Methods - 图3 <CDAudioInterruptProtocol> <CDAudioInterruptProtocol>

## Instance Methods
(void) - preloadBackgroundMusic:
Preloads a music file so it will be ready to play as background music. 更多…
(void) - playBackgroundMusic:
plays background music in a loop 更多…
(void) - playBackgroundMusic:loop:
plays background music, if loop is true the music will repeat otherwise it will be played once 更多…
(void) - stopBackgroundMusic
stops playing background music 更多…
(void) - pauseBackgroundMusic
pauses the background music 更多…
(void) - resumeBackgroundMusic
resume background music that has been paused 更多…
(void) - rewindBackgroundMusic
rewind the background music 更多…
(BOOL) - isBackgroundMusicPlaying
returns whether or not the background music is playing 更多…
(ALuint) - playEffect:loop:
plays an audio effect with a file path 更多…
(void) - stopEffect:
stop a sound that is playing, note you must pass in the soundId that is returned when you started playing the sound with playEffect 更多…
(ALuint) - playEffect:loop:pitch:pan:gain:
plays an audio effect with a file path, pitch, pan and gain 更多…
(void) - pauseEffect:
pause an audio 更多…
(void) - pauseAllEffects
pause all audioes 更多…
(void) - resumeEffect:
resume an audio 更多…
(void) - resumeAllEffects
resume all audioes 更多…
(void) - stopAllEffects
stop all audioes 更多…
(void) - preloadEffect:
preloads an audio effect 更多…
(void) - unloadEffect:
unloads an audio effect from memory 更多…
(CDSoundSource ) - soundSourceForFile:
Gets a CDSoundSource object set up to play the specified file. 更多…
(void) - preloadBackgroundMusic:
Preloads a music file so it will be ready to play as background music. 更多…
(void) - playBackgroundMusic:
plays background music in a loop 更多…
(void) - playBackgroundMusic:loop:
plays background music, if loop is true the music will repeat otherwise it will be played once 更多…
(void) - stopBackgroundMusic
stops playing background music 更多…
(void) - pauseBackgroundMusic
pauses the background music 更多…
(void) - resumeBackgroundMusic
resume background music that has been paused 更多…
(void) - rewindBackgroundMusic
rewind the background music 更多…
(BOOL) - isBackgroundMusicPlaying
returns whether or not the background music is playing 更多…
(ALuint) - playEffect:loop:
plays an audio effect with a file path 更多…
(void) - stopEffect:
stop a sound that is playing, note you must pass in the soundId that is returned when you started playing the sound with playEffect 更多…
(ALuint) - playEffect:loop:pitch:pan:gain:
plays an audio effect with a file path, pitch, pan and gain 更多…
(void) - pauseEffect:
pause an audio 更多…
(void) - pauseAllEffects
pause all audioes 更多…
(void) - resumeEffect:
resume an audio 更多…
(void) - resumeAllEffects
resume all audioes 更多…
(void) - stopAllEffects
stop all audioes 更多…
(void) - preloadEffect:
preloads an audio effect 更多…
(void) - unloadEffect:
unloads an audio effect from memory 更多…
(CDSoundSource ) - soundSourceForFile:
Gets a CDSoundSource object set up to play the specified file. 更多…
- Instance Methods 继承自 <CDAudioInterruptProtocol>
(BOOL) - mute
Is audio mute. 更多…
(void) - setMute:
If YES then audio is silenced but not stopped, calls to start new audio will proceed but silently. 更多…
(BOOL) - enabled
Is audio enabled. 更多…
(void) - setEnabled:
If NO then all audio is stopped and any calls to start new audio will be ignored. 更多…
(BOOL) - mute
Is audio mute. 更多…
(void) - setMute:
If YES then audio is silenced but not stopped, calls to start new audio will proceed but silently. 更多…
(BOOL) - enabled
Is audio enabled. 更多…
(void) - setEnabled:
If NO then all audio is stopped and any calls to start new audio will be ignored. 更多…
## Class Methods
(SimpleAudioEngine ) + sharedEngine
returns the shared instance of the SimpleAudioEngine object 更多…
(void) + end
Shuts down the shared audio engine instance so that it can be reinitialised. 更多…
(SimpleAudioEngine ) + sharedEngine
returns the shared instance of the SimpleAudioEngine object 更多…
(void) + end
Shuts down the shared audio engine instance so that it can be reinitialised. 更多…
## Protected 属性
BOOL mute_
BOOL enabled_
## 属性
float backgroundMusicVolume
Background music volume. 更多…
float effectsVolume
Effects volume. 更多…
BOOL willPlayBackgroundMusic
If NO it indicates background music will not be played either because no background music is loaded or the audio session does not permit it. 更多…

详细描述

A wrapper to the CDAudioManager object.

This is recommended for basic audio requirements. If you just want to play some sound fx and some background music and have no interest in learning the lower level workings then this is the interface to use.

Requirements:

Method Documentation

+ (void) end

Shuts down the shared audio engine instance so that it can be reinitialised.

+ (void) end

Shuts down the shared audio engine instance so that it can be reinitialised.

- (BOOL) isBackgroundMusicPlaying

returns whether or not the background music is playing

- (BOOL) isBackgroundMusicPlaying

returns whether or not the background music is playing

- (void) pauseAllEffects

pause all audioes

- (void) pauseAllEffects

pause all audioes

- (void) pauseBackgroundMusic

pauses the background music

- (void) pauseBackgroundMusic

pauses the background music

- (void) pauseEffect: (ALuint) soundId

pause an audio

- (void) pauseEffect: (ALuint) soundId

pause an audio

- (void) playBackgroundMusic: (NSString *) filePath

plays background music in a loop

- (void) playBackgroundMusic: (NSString *) filePath

plays background music in a loop

- (void) playBackgroundMusic: (NSString *) filePath
loop: (BOOL) loop

plays background music, if loop is true the music will repeat otherwise it will be played once

- (void) playBackgroundMusic: (NSString *) filePath
loop: (BOOL) loop

plays background music, if loop is true the music will repeat otherwise it will be played once

- (ALuint) playEffect: (NSString *) filePath
loop: (BOOL) loop

plays an audio effect with a file path

- (ALuint) playEffect: (NSString *) filePath
loop: (BOOL) loop

plays an audio effect with a file path

- (ALuint) playEffect: (NSString *) filePath
loop: (BOOL) loop
pitch: (Float32) pitch
pan: (Float32) pan
gain: (Float32) gain

plays an audio effect with a file path, pitch, pan and gain

- (ALuint) playEffect: (NSString *) filePath
loop: (BOOL) loop
pitch: (Float32) pitch
pan: (Float32) pan
gain: (Float32) gain

plays an audio effect with a file path, pitch, pan and gain

- (void) preloadBackgroundMusic: (NSString *) filePath

Preloads a music file so it will be ready to play as background music.

- (void) preloadBackgroundMusic: (NSString *) filePath

Preloads a music file so it will be ready to play as background music.

- (void) preloadEffect: (NSString *) filePath

preloads an audio effect

- (void) preloadEffect: (NSString *) filePath

preloads an audio effect

- (void) resumeAllEffects

resume all audioes

- (void) resumeAllEffects

resume all audioes

- (void) resumeBackgroundMusic

resume background music that has been paused

- (void) resumeBackgroundMusic

resume background music that has been paused

- (void) resumeEffect: (ALuint) soundId

resume an audio

- (void) resumeEffect: (ALuint) soundId

resume an audio

- (void) rewindBackgroundMusic

rewind the background music

- (void) rewindBackgroundMusic

rewind the background music

+ (SimpleAudioEngine*) sharedEngine

returns the shared instance of the SimpleAudioEngine object

+ (SimpleAudioEngine*) sharedEngine

returns the shared instance of the SimpleAudioEngine object

- (CDSoundSource ) soundSourceForFile: (NSString ) filePath

Gets a CDSoundSource object set up to play the specified file.

- (CDSoundSource ) soundSourceForFile: (NSString ) filePath

Gets a CDSoundSource object set up to play the specified file.

- (void) stopAllEffects

stop all audioes

- (void) stopAllEffects

stop all audioes

- (void) stopBackgroundMusic

stops playing background music

- (void) stopBackgroundMusic

stops playing background music

- (void) stopEffect: (ALuint) soundId

stop a sound that is playing, note you must pass in the soundId that is returned when you started playing the sound with playEffect

- (void) stopEffect: (ALuint) soundId

stop a sound that is playing, note you must pass in the soundId that is returned when you started playing the sound with playEffect

- (void) unloadEffect: (NSString *) filePath

unloads an audio effect from memory

- (void) unloadEffect: (NSString *) filePath

unloads an audio effect from memory

类成员变量说明

- (BOOL) enabled_

protected

- (BOOL) mute_

protected

属性说明

- (float) backgroundMusicVolume

readwriteatomicassign

Background music volume.

Range is 0.0f to 1.0f. This will only have an effect if willPlayBackgroundMusic returns YES

- (float) effectsVolume

readwriteatomicassign

Effects volume.

Range is 0.0f to 1.0f

- (BOOL) willPlayBackgroundMusic

readatomicassign

If NO it indicates background music will not be played either because no background music is loaded or the audio session does not permit it.


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

  • SimpleAudioEngine
  • 生成于 2014年 五月 29日 星期四 09:41:43 , 为 cocos2d-x使用 doxygen 1.8.6