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

volume issue with sample event #176

Open YogarajRamesh opened 1 year ago

YogarajRamesh commented 1 year ago

Hi @igorski , while playing sample event some segment play with low volume and some play with high volume and it happens random. even after I set the sample event.setVolum(1.0f); The volume vary for random segment during event.play();. I am trying to get constant and maximum volume of the sample event.

Thanks in advance

igorski commented 1 year ago

Hi @YogarajRamesh

That's odd. Does this happen to playback of the event in isolation too ? Is there any gain pumping processor (such as limiter) active in the chain?

YogarajRamesh commented 1 year ago

Hi @igorski Yes even when the playback event is isolated it happens. And there is no gain pumping processor added. While checking this I found something that every time I loop back the recorded output as sample event it reduce the volume.

Here is the sample recording https://mega.nz/file/25B1ADgZ#k18Jx30a4NdEM-pX8CT1A-qk7QXbhae90S0Ntnzex0c

At first I count 1 to 10 then send back the audio as sample event and count from 11 to 20. And so on.. At fourth time the sound volume of the first time is almost zero.

The above recording is 5th time output

Seems every time I loop back there is considerable amount of data loss

How to prevent the data loss(sound Loss)???

Thanks in advance