Book Image

Mastering Cocos2d Game Development

By : Alex Ogorek
Book Image

Mastering Cocos2d Game Development

By: Alex Ogorek

Overview of this book

Table of Contents (15 chapters)
Mastering Cocos2d Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Learning about OALSimpleAudio


If you've ever wanted an easy way to play sound files, OALSimpleAudio is the thing you need. It can very easily load a large variety of sound files, play effects, loop background music, and a lot more. Its existence and integration with Cocos2d makes it much easier to bring your game to life with the immersive capabilities of sound and music.

Tip

If you've programmed in Cocos2d before and are wondering where SimpleAudioEngine is, starting in Cocos2d v3.0, OALSimpleAudio is the new way to play sound effects. It's basically everything that SimpleAudioEngine was.

Preloading effects

If you try to play an effect using OALSimpleAudio, there will be a slight freeze, or delay, as the device tries to quickly load the effect into the memory and then play it right away. Luckily, there's a way to load the sound effects and music such that it doesn't freeze in front of your users when you try to play an effect.

OALSimpleAudio allows preloading of effects, which essentially reads...