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

Is it possible to add audio effects like echo,delay with song in android using this lib ? #152

Closed YogarajRamesh closed 2 years ago

YogarajRamesh commented 2 years ago

Hi, How to add live effects like echo , reverb in recorded audio and live feedback using MWEngine?

igorski commented 2 years ago

Hi, basically you are looking to add a Processor to the AudioChannels ProcessingChain.

Basically each instrument (whether a SynthInstrument or SampledInstrument) has an AudioChannel associated with it that has a ProcessingChain (think of it as a bus on a mixing desk). Here you can insert effects, all effects are processed live and work the same whether the AudioChannel is linked to an instrument, or playing back the input of your device.

Considering your other question I am assuming you intend to add effects to the live microphone input. You can access the AudioChannel of the device input through the MWEngine class, e.g.:

nl.igorski.mwengine.MWEngine.getInputChannel()

You can see the basic MWEngineActivity to see an example on how to add effects processors to audio channels (see line 245 onwards). MWEngine comes with a selection of processors such as echo and reverb.

YogarajRamesh commented 2 years ago

Thank you so much for your response.

Magesh-mahi commented 2 years ago

hi, @YogarajRamesh .

you can add reverb to the live. by add processor .

if you want to use reverb make sure use OUTPUT_CHANNELS=1(mono). when i try to do the same with 2 i got my app crashed.

igorski commented 2 years ago

Hi @Magesh-mahi the mono issue is resolved in 40ed839cf3c385153853836f5e454e723069420c

I'm closing this issue as the linked Wiki pages address the question. Issues with processors (such as aforementioned reverb issue) can be tackled in separate requests to not clutter the issue tracker.