Adding Music
Music for Android is exciting. Some interesting technology provides amazing functionality. Before you look into these options, let’s play a MIDI song file during game play. Your old friend the MediaPlayer class performs this perfectly because it’s designed to play all the media files in Android.
Although music is generally longer than a sound effect, and you use a different file format, it’s handled nearly identically to the sound effects in the previous sections.
To get free sound effects, you went to www.freesounds.org. For MIDI audios, I use www.midiworld.com. The site provides a large library of .midi files that you can use in your own creations. Under the Pop category, I found “Take a Chance on Me” by ABBA. Let’s add it to your ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access