Chapter 9. Adding Sounds and Effects

This is the final phase of development of the game. In this section, we will look at how to add background music and sound effects in the game. We will also look at the different formats that each platform supports and see how we can convert the audio formats for the different platforms using freeware. Also, we will add a toggle button that will pause and resume the background music.

The topics covered in this chapter are as follows:

  • Audio in Cocos2d-x
  • Adding looped background music
  • Adding sound effects
  • Adding the mute button

Audio in Cocos2d-x

As Cocos2d-x supports various platforms, it needs to support the audio formats in each of the platforms as well. It is recommended that you use platform-specific format for ...

Get Learning Cocos2d-x Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.