Chapter 23. Android Sound Effects and the Spinner Widget
In this chapter, we will study the SoundPool
class and the different ways we can use it depending on whether we just want to play sounds or go further and keep track of the sounds we are playing. Then, we will put everything we will have learned into action by producing a cool sound demo app, which will also introduce us to a new UI widget: the spinner.
In this chapter, we will do the following:
- Learn how to use the Android
SoundPool
class - Code a sound-based app using
SpinnerView
Let's get started.
The SoundPool class
The SoundPool
class allows us to hold and manipulate a collection of sound effects: literally, a pool of sounds. The class handles everything from decompressing a sound file, such ...
Get Android Programming with Kotlin for Beginners 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.