O'Reilly logo

Learning Cocos2D: A Hands-On Guide to Building iOS Games with Cocos2D, Box2D, and Chipmunk by Ray Wenderlich, Rod Strougo

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

8. Pump Up the Volume!

In the last chapter you learned how to create menus and link scenes together in your games. Now it is time to head back into the gameplay and add music and sound effects to Space Viking. In this chapter you will learn how to use the audio engine included with Cocos2D and how you can add audio to your own games. Read on to hear what Ole the Viking sounds like, and find out what sounds break the silence of the alien planet.

Introducing CocosDenshion

Apple provides two great frameworks to play audio on iOS devices, AVAudioPlayer and OpenAL. AVAudioPlayer is a quick and simple way to play audio but gives you only limited control, while OpenAL is a lower-level API with more features.

Cocos2D comes bundled with the CocosDenshion ...

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