[PowerPlay] Integrate Audio Effect Into PowerPlay#2380
Open
madebymozart wants to merge 7 commits into
Open
Conversation
- Introduced `EffectsController` to manage audio effects. - Refactored `Equalizer` into `EqualizerManager`. - Added `BassBoostManager`, `VirtualizerManager`, `ReverbManager`, and `LoudnessManager`. - Updated `PowerPlayAudioPlayer` to use `EffectsController`. - Replaced `EqualizerBottomSheetContent` with a new `EffectsBottomSheet` featuring tabs for Equalizer, Bass Boost, Virtualizer, Reverb, and Loudness.
This commit removes all code related to the Virtualizer audio effect from the PowerPlay sample, including: * Deletion of `VirtualizerManager.kt` * Deletion of `VirtualizerTab.kt` * Removal of Virtualizer from `EffectsBottomSheet` tabs and UI * Removal of Virtualizer initialization and management from `EffectsController`
- Remove `setEnabled` and `isEnabled` from `BassBoostManager` and `EqualizerManager`. - Rename equalizer UI elements to general effects UI in `MainActivity`. - Remove `private val` from `sessionId` in effect manager constructors.
…ay only supported audio effects
flamme
reviewed
May 14, 2026
| @@ -0,0 +1,35 @@ | |||
| package com.google.oboe.samples.powerplay.effects | |||
Collaborator
There was a problem hiding this comment.
nit, please add copyright declaration for all new added files.
…g license headers to Kotlin source files
robertwu1
reviewed
May 14, 2026
| ->setContentType(ContentType::Music) | ||
| ->setFramesPerDataCallback(128) | ||
| ->setSharingMode(SharingMode::Exclusive); | ||
| ->setSessionId(oboe::SessionId::Allocate); |
Collaborator
There was a problem hiding this comment.
By allocating session id, all the paths will not be on a low latency path...
Please try playing with the settings in OboeTester to see what happens when you do this.
That's why we have been telling folks to add their own effects in the app if possible and not rely on platform effects.
BassBoost, Equalizer, and Loudness effects can easily be written without using the AudioEffect from Android. The app can easily implement this as it renders audio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a comprehensive audio effects system to the PowerPlay sample app. It leverages Android's native audio effects (Equalizer, Bass Boost, Reverb, and Loudness Enhancer) by attaching them to the Oboe audio stream via session ID allocation. It also adds a polished UI with a bottom sheet containing tabs for each effect, allowing users to customize their audio experience in real-time.
Changes
C++ Engine (PowerPlayMultiPlayer.cpp)
SessionId::Allocate) to allow attaching Android audio effects.getSessionId()to retrieve the allocated session ID from the stream.JNI (PowerPlayJNI.cpp)
getSessionIdNativeto expose the stream's session ID to the Kotlin layer.Kotlin Audio Player (PowerPlayAudioPlayer.kt)
EffectsControllerto initialize and release audio effects when the stream is created or when the performance mode changes (which recreates the stream).Audio Effects Managers (EffectsController.kt)
EffectsControllerto query supported effects and manage instances ofEqualizerManager,BassBoostManager,ReverbManager, andLoudnessManager.AudioEffectAPIs.Jetpack Compose UI (MainActivity.kt)
EffectsBottomSheetcomposable.EqualizerTab,BassBoostTab,ReverbTab,LoudnessTab) inside the bottom sheet.Effects Support Matrix
The availability of effects depends on hardware support and is queried dynamically at runtime:
Note
If an effect is not supported by the device's hardware/HAL, it will not be initialized and its tab will not appear or will be disabled.
How to Test
Visuals