Skip to main content

CCSimpleAudioEngine

CCSimpleAudioEngine

CocosDenshion

Inheritance: System.Object

Constructors

CCSimpleAudioEngine()

CCSimpleAudioEngine()()

Properties

BackgroundMusicVolume(System.Single)
EffectsVolume(System.Single)
SharedEngine(CocosDenshion.CCSimpleAudioEngine)

The singleton instance of this class.

SharedList(System.Collections.Generic.DictionarySystem.Int32,CocosDenshion.CCEffectPlayer)

The shared sound effect list. The key is the hashcode of the file path.

Methods

End()

End()()
Example

FullPath(string)

System.String FullPath(string)(System.String szPath)
Parameters:
szPath (System.String)
Returns:
System.String

IsBackgroundMusicPlaying()

System.Boolean IsBackgroundMusicPlaying()()
Returns:
System.Boolean
Example

PauseAllEffects()

PauseAllEffects()()

PauseBackgroundMusic()

PauseBackgroundMusic()()
Example

PauseEffect(int)

PauseEffect(int)(System.Int32 fxid)
Parameters:
fxid (System.Int32)

PlayBackgroundMusic(string)

PlayBackgroundMusic(string)(System.String pszFilePath)
Parameters:
pszFilePath (System.String)
Example

PlayBackgroundMusic(string, bool)

PlayBackgroundMusic(string, bool)(System.String pszFilePath, System.Boolean bLoop)
Parameters:
pszFilePath (System.String)
bLoop (System.Boolean)
Example

PlayEffect(int)

System.Int32 PlayEffect(int)(System.Int32 fxid)
Parameters:
fxid (System.Int32)
Returns:
System.Int32

PlayEffect(int, bool)

System.Int32 PlayEffect(int, bool)(System.Int32 fxid, System.Boolean bLoop)
Parameters:
fxid (System.Int32)
bLoop (System.Boolean)
Returns:
System.Int32

PlayEffect(string)

System.Int32 PlayEffect(string)(System.String pszFilePath)

Plays the given sound effect without looping.

Parameters:
pszFilePath (System.String) - The path to the sound effect
Returns:
System.Int32
Example

PlayEffect(string, bool)

System.Int32 PlayEffect(string, bool)(System.String pszFilePath, System.Boolean bLoop)

Play the sound effect with the given path and optionally set it to lopo.

Parameters:
pszFilePath (System.String) - The path to the sound effect file.
bLoop (System.Boolean) - True if the sound effect will play continuously, and false if it will play then stop.
Returns:
System.Int32
Example

PreloadBackgroundMusic(string)

PreloadBackgroundMusic(string)(System.String pszFilePath)
Parameters:
pszFilePath (System.String)
Example

PreloadEffect(string)

PreloadEffect(string)(System.String pszFilePath)

Load the sound effect found with the given path. The sound effect is only loaded one time and the effect is cached as an instance of EffectPlayer.

Parameters:
pszFilePath (System.String)
Example

RestoreMediaState()

RestoreMediaState()()

Restore the media player's state to how it was prior to the game launch. You need to do this when the game terminates if you run music that clobbers the music that was playing before the game launched.

Example

ResumeAllEffects()

ResumeAllEffects()()

ResumeBackgroundMusic()

ResumeBackgroundMusic()()
Example

RewindBackgroundMusic()

RewindBackgroundMusic()()
Example

SaveMediaState()

SaveMediaState()()

Save the media player's current playback state.

Example

StopAllEffects()

StopAllEffects()()

StopAllLoopingEffects()

StopAllLoopingEffects()()

Stops all of the sound effects that are currently playing and looping.

Example

StopBackgroundMusic()

StopBackgroundMusic()()
Example

StopBackgroundMusic(bool)

StopBackgroundMusic(bool)(System.Boolean bReleaseData)
Parameters:
bReleaseData (System.Boolean)
Example

StopEffect(int)

StopEffect(int)(System.Int32 nSoundId)

Stops the sound effect with the given id.

Parameters:
nSoundId (System.Int32)
Example

UnloadEffect(string)

UnloadEffect(string)(System.String pszFilePath)
Parameters:
pszFilePath (System.String)
Example

WillPlayBackgroundMusic()

System.Boolean WillPlayBackgroundMusic()()
Returns:
System.Boolean