Skip to content

Commit 923e9d2

Browse files
authored
Merge branch 'google:main' into tap2tone
2 parents a84e519 + 0cac04d commit 923e9d2

6 files changed

Lines changed: 33 additions & 3 deletions

File tree

samples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ There is an associated codelab to follow along with. (Java)
1212
1. [LiveEffect](LiveEffect): Loops audio from input stream to output stream to demonstrate duplex capability. (Java)
1313
1. [SoundBoard](SoundBoard): A 25 to 40 note dynamic synthesizer, demonstating combining signals. The stream restarts
1414
when the display rotates. (Kotlin)
15+
1. [OboeDJ](OboeDJ): A high-performance DJ app with two independent playback decks and real-time scratching. (Kotlin/Compose)
16+
1. [PowerPlay](powerplay): Demonstrates power-efficient audio features like PCM Offload and automation via ADB. (Kotlin/Compose)
1517

1618
Pre-requisites
1719
-------------

samples/powerplay/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/powerplay/README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1-
# PowerPlay
1+
# PowerPlay Sample
22

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>
535 KB
Loading
169 KB
Loading
317 KB
Loading

0 commit comments

Comments
 (0)