igorski / MWEngine

Audio engine and DSP library for Android, written in C++ providing low latency performance within a musical context, while providing a Java/Kotlin API. Supports both OpenSL and AAudio.
MIT License
257 stars 45 forks source link

[Features Request] Real-time Effect FX #135

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello, MWEngine provided recording feature with real-time voice feedback, that was amazing stuff that I really want. BTW, I would like to extend more fun stuff over the existing one such as apply new Effects like Echo, Delay etc. like this (https://github.com/google/oboe/tree/master/apps/fxlab).

Do you know how to apply this into MWEngine?

igorski commented 3 years ago

Hi,

if I understand correctly you would like to have real time effects processing over an audio input stream (in other words: record input from the device microphone and immediately apply effects during real-time playback) ?

If that's the case, then you need to look into the ProcessingChain

Basically all instruments render their audio onto an AudioChannel (similar to a channel strip on a mixer). Every AudioChannel has its individual ProcessingChain where you can add multiple effects modules to. The same goes for the AudioChannel for an incoming audio stream (which you can get from MWEngineInstance. getInputChannel()). All effects modules are applied in real time (so also when recording audio).

You can also view the example activity in this repository where one of the synth instruments has a live delay effect, making adjustments to the delay feedback parameter has an instant effect.

ghost commented 3 years ago

Thank @igorski for your information. you're right. I want to record input from the device microphone and immediately apply effects during real-time playback. I'll check out the process chain for more. Thank.