O'Reilly logo

Android Game Programming by Example by John Horton

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

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 ...

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