Adding sound FX

Adding sound effects in Android is really straightforward. First, let's look at where we can get our sound FX from. If you just want to get on with the coding, you can use my sound FX in the Chapter4/assets folder.

Generating the FX

We require four sound FX for our Tappy Defender game:

  • The sound for when our player crashes into an alien, which we will call bump.ogg.
  • The sound for when the player is destroyed, which we will call destroyed.ogg.
  • A fun sound for when the game first begins, which we will call start.ogg.
  • Finally, a victory whoop-type sound, which we will call win.ogg.

Here is a very quick guide to make these sound FX using BFXR. Grab a free copy of BFXR from www.bfxr.net.

Follow the simple instructions on the website to set ...

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.