google / oboe

Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.
Apache License 2.0
3.71k stars 569 forks source link

external effects #567

Closed mgood7123 closed 5 years ago

mgood7123 commented 5 years ago

how would I use external effects such as ViPER4Android, as most media apps support ViPER and I am unable to figure out how to get it to process oboe's audio

atneya commented 5 years ago

To my knowledge, ViPER4Android is a root-based solution that intercepts system audio and applies effects to it.

If you are trying to apply similar effects within your app, you would simply need to implement the effects that ViPER does.

However, the way exclusive, low-latency streams work in Oboe seems incompatible with ViPER, as writing audio directly to the DSP would not allow it to be intercepted by these types of system-wide effects. If you would like to use Oboe to render audio, and have end-users be able to use solutions like ViPER, you would most likely have to avoid using low-latency streams (and even still behavior is not guaranteed with apps relying on root access). In order to provide the lowest latency possible, Oboe pushes things like audio effects to the application level.

mgood7123 commented 5 years ago

ok so streamBuilder.setPerformanceMode(oboe::PerformanceMode::PowerSaving); and streamBuilder.setPerformanceMode(oboe::PerformanceMode::None); appears to make it able to be processed by system-wide effects, however it seems to sometimes (possibly rarely, im not sure) crash very shortly after playing audio

atneya commented 5 years ago

That would match my understanding of how ViPER processes audio. Like I mentioned in the previous comment, the trade off of low latency is avoiding many system-wide audio frameworks, that allow for system-wide modifications.

atneya commented 5 years ago

Closing this question, re-open if any additional discussion on this question comes up.