|
1 | | -# PowerPlay |
| 1 | +# PowerPlay Sample |
2 | 2 |
|
3 | | -TBD |
| 3 | +An energy-efficient audio player sample application demonstrating the use of the Performance Modes in Oboe library. It showcases different audio performance modes, including low-latency, power-saving, and hardware PCM offload, wrapped in a modern Jetpack Compose UI. |
| 4 | + |
| 5 | +## Features |
| 6 | +- **Performance Modes**: Switch between None, Low Latency, Power Saving, and hardware PCM Offload playback modes. |
| 7 | +- **PCM Offload**: Support for hardware PCM Offloaded playback to dramatically reduce power consumption for continuous playback. |
| 8 | +- **Audio API Selection**: Toggle between MMAP and Classic audio pathways. |
| 9 | +- **Dynamic Playback**: Play bundled audio tracks or load custom local WAV files from your device. |
| 10 | +- **Intent Automation**: Support for automation via ADB intents to control playback, modes, and configurations programmatically. |
| 11 | +- **Foreground Service**: Ensures uninterrupted audio playback while the app is in the background or the screen is off. |
| 12 | + |
| 13 | +## UI Overview |
| 14 | +- **Play/Pause Button**: Controls playback for the current track. |
| 15 | +- **Seek Bar**: Adjust the current playback position. Only available in non-offload modes. |
| 16 | +- **Settings Bottom Sheet**: Configure performance modes (Low Latency, Power Saving, PCM Offload), adjust requested buffer size in frames, and toggle MMAP. |
| 17 | +- **Info Dialog**: View details about the current audio mode, WAV file properties (Sample Rate, Channels, Bit Depth, Duration), and actual buffer size. |
| 18 | +- **Add Local File**: Load custom WAV files directly from your device storage to add to your queue. |
| 19 | + |
| 20 | +## Technical Details |
| 21 | +- **Engine**: C++ `PowerPlayMultiPlayer` managing Oboe streams, buffer sizing, and performance configurations. |
| 22 | +- **Audio Format**: Uses Float PCM audio encoding with stereo output. |
| 23 | +- **Automation**: `IntentBasedTestSupport` allows programmatic control via Android Intents for robust testing. For more information, see the [Automation Guide](QuickStart_Automation.md). |
| 24 | +- **State Management**: Jetpack Compose manages the UI states and synchronizes them with the underlying C++ audio engine. |
| 25 | + |
| 26 | +Images |
| 27 | +----------- |
| 28 | +<p align="center"> |
| 29 | + <img src="images/powerplay_image1.png" alt="powerplay_image1" width="250"/> |
| 30 | + <img src="images/powerplay_image2.png" alt="powerplay_image2" width="250"/> |
| 31 | + <img src="images/powerplay_image3.png" alt="powerplay_image3" width="250"/> |
| 32 | +</p> |
0 commit comments