Ahmed Mamdouh

01/06/2019, 2:57 PM
hey guys , is there known issues regarding the use of Kotlin with NDK ? i was using superpoweredsdk with kotlin and found out that maybe primitive data types are being altered when using JNI methods , because the output sound has latency and not the original pitch of the audio track is being played , while in java everything is normal , i am now forced to work with java , any thoughts ?

Egor Trutenko

01/06/2019, 5:49 PM
Off-hand guess is that your primitives get boxed, a process which you may easily miss in Kotlin, since it doesn't make syntactic difference between boxed and unboxed type. So it gets boxed and instead of its value you pass a pointer into JNI. Anyways, I guess the problem is with boxing.
👍 1


01/06/2019, 7:41 PM
We use Kotlin and NDK (also for audio) don't have any issues Latency may be related to boxing but changed pitch is something really strange and looks as a some problem in your code. Maybe you could show some code
👍 1

Ahmed Mamdouh

01/06/2019, 8:07 PM
thank you
i'm new to c++ and to pointers , i just wanted a lead as it was a dead end for me , thank you guys really helpful !