O'Reilly logo

Cocos2d Cross-Platform Game Development Cookbook - Second Edition by Siddharth Shekar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Audio

The topics covered in this chapter are:

  • Adding background music
  • Adding audio effects
  • Adding a mute button
  • Adding a volume slider
  • Adding a pause and resume button

Introduction

Although widely overlooked and mostly added as an afterthought to a game, audio is very crucial for the feel of a game. A good game soundtrack can enhance the game without any additional bells and whistles.

With Cocos2d, adding audio, such as background music or sound effects in your application or game, is very easy. Usually in games, there are two kinds of audio file that are used. The first one is the background music, which is played at the start of the game and usually continues to be played throughout the game. Background music is a piece of music that may ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required