Chapter 14
Playing Audio in Android: The MediaPlayer Class
In this chapter, we will take the digital audio assets that we optimized in the previous chapter and teach you how to implement them for playback in your Hello_World AttackPlanet.java Activity event handling code.
We’ll add sound effects to the Attack a Planet user interface ImageButton elements, so that when users click these animated buttons the digital audio will playback, adding to the already impressive visual effects we created in the graphics design and animation chapters previously.
Now that you know how to optimize audio for use in Android, we’ll also use some higher-quality audio from world-renowned sound designer and music composer Frank Serafine, who is a friend of mine ...
Get Learn Android App Development 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.