Maestro is an Android application that demonstrates synchronized audio playback using the Oboe Audio Library. The app is designed to play multiple audio tracks simultaneously while keeping them perfectly synchronized, making it ideal for applications like multi-track music players, stem-based mixing, and audio production tools.
- Multi-track Playback: Play multiple audio tracks simultaneously with perfect synchronization
- Individual Track Control: Mute/unmute individual tracks during playback
- Seeking: Seek through the entire composition while maintaining synchronization
- Low Latency: Leverages Android's Oboe library for high-performance, low-latency audio
- Native Performance: Uses C++ for audio processing with JNI bridging to the Android UI
The project is structured as follows:
-
Native Layer (C++)
- Uses the Oboe library for low-latency audio playback
- Implements a custom audio engine in
Maestro.cpp
/Maestro.h
- Handles audio data extraction and processing
- Provides JNI interface through
maestro-bridge.cpp
-
Android Layer (Kotlin)
- Provides a simple UI to control playback
- Handles native library initialization
- Manages audio lifecycle events
- Android Studio 4.1+
- Android SDK 21+
- NDK 25.2.9519653
- CMake 3.10.2+
- FFmpeg libraries for audio decoding
- Clone the repository
- Open the project in Android Studio
- Make sure NDK is installed through the SDK Manager
- Build and run the project on an Android device
The sample app demonstrates multiple audio tracks (stems) that can be individually controlled:
- Tap on a track's play/pause button to toggle that track
- Use the main playback controls to play/pause all tracks
- Use the seek bar to navigate through the tracks
Maestro synchronizes audio playback by:
- Loading all audio tracks into memory
- Creating an Oboe audio stream
- Mixing audio data from multiple sources in real-time
- Maintaining a single playback position for all tracks
This project is provided as an example implementation and proof of concept.