Conforms to NSObject
Declared in CocosDenshion.h

Overview

@file @b IMPORTANT There are 3 different ways of using CocosDenshion. Depending on which you choose you will need to include different files and frameworks.

@par SimpleAudioEngine 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: – Firmware: OS 2.2 or greater – Files: SimpleAudioEngine., CocosDenshion. – Frameworks: OpenAL, AudioToolbox, AVFoundation

@par CDAudioManager CDAudioManager is basically a thin wrapper around an AVAudioPlayer object used for playing background music and a CDSoundEngine object used for playing sound effects. It manages the audio session for you deals with audio session interruption. It is fairly low level and it is expected you have some understanding of the underlying technologies. For example, for many use cases regarding background music it is expected you will work directly with the backgroundMusic AVAudioPlayer which is exposed as a property.

Requirements: – Firmware: OS 2.2 or greater – Files: CDAudioManager., CocosDenshion. – Frameworks: OpenAL, AudioToolbox, AVFoundation

@par CDSoundEngine CDSoundEngine is a sound engine built upon OpenAL and derived from Apple’s oalTouch example. It can playback up to 32 sounds simultaneously with control over pitch, pan and gain. It can be set up to handle audio session interruption automatically. You may decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine because you require OS 2.0 compatibility.

Requirements: – Firmware: OS 2.0 or greater – Files: CocosDenshion.* – Frameworks: OpenAL, AudioToolbox

Tasks

  • – play

    Play the audio

    required method
  • – pause

    Pause the audio, retain resources

    required method
  • – stop

    Stop the audio, release resources

    required method
  • – rewind

    Return playback to beginning

    required method

Instance Methods

pause

Pause the audio, retain resources

- (BOOL)pause

Declared In

CocosDenshion.h

play

Play the audio

- (BOOL)play

Declared In

CocosDenshion.h

rewind

Return playback to beginning

- (BOOL)rewind

Declared In

CocosDenshion.h

stop

Stop the audio, release resources

- (BOOL)stop

Declared In

CocosDenshion.h