Chapter 6. Playing Sounds
A game without sound will be boring and lifeless. Background music and sound effects that suit the visuals will lighten up the game. Initially, we used a very famous audio engine called SimpleAudioEngine
, but Cocos2d-x version 3.3 has now come up with an all-new AudioEngine
. In this chapter, we're going to talk about both SimpleAudioEngine
and AudioEngine
. The following topics will be covered in this chapter:
- Playing background music
- Playing a sound effect
- Controlling volume, pitch, and balance
- Pausing and resuming background music
- Pausing and resuming sound effects
- Playing background music and a sound effect by using AudioEngine
- Playing movies