Sound FX

Sound effects will be used for events in the game such as explosions, firing bullets, and so on, but also could be used in other cases such as menu clicks and dialogs appearing. In our game we will add sound effects to the explosions of the asteroids and the spaceship as well as for laser firing.

We will begin discussing some ways to get sound effects for games. We cannot work if we don't have sound files, right?

Once we have our sounds in place, we will update GameEngine to provide a way to signal events in the game, and we will let SoundManager know when one of those events happens.

Finally we will explain how SoundPool works and how to include it in our SoundManager, associating a game event to a sound effect.

Hands on—let's get some ...

Get Android Game Programming: A Developer’s Guide 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.