Oboe playback sample app.
DrumThumper is a “Drum Pad” app which demonstrates best-practices for low-latency audio playback using the Android Oboe API. DrumThumper consists of a set of trigger pad widgets and an optional UI for controlling the level and stereo placement of each of the virtual drums. The audio samples are stored in application resources as WAV data. This is parsed and loaded (by routines in parselib) into memory blocks. The audio samples are mixed and played by routines in iolib.
DrumThumper is written in a combination of Kotlin for the UI and JNI/C++ for the player components (to demonstrate accessing native code from a Kotlin or Java application).
DrumThumper is designed with the following goals in mind:
Secondarily, DrumThumper demonstrates:
To keep things simple, DrumThumper specifically does not:
DrumThumper now supports different sample rates for the source samples.
If one wanted to extend DrumThumper to support Stereo samples:
Contains classes for the application logic and defines the methods for accessing the native data and player functionality.
Contains the implementation of the native
(JNI) methods defined in the DrumPlayer
(Kotlin) class.
iolib Classes for playing audio data.
parselib Classes for parsing and loading audio data from WAV resources.
DrumPlayer.kt The Kotlin class which provides the audio playback functionality by interfacing with the native (C++) libraries.
DrumThumperActivity.kt The main application logic.
TriggerPad.kt An Android View subclass which implements the “trigger pad” UI widgets