I've noticed that the C++ classes underlying the AudioTrack
and AudioRecord
APIs in Android both have a latency()
method that is not exposed via JNI. As far as I can see, the latency()
method in AudioRecord
still does not take into account the hardware latency (they have a TODO comment for that), but the latency()
method in AudioTrack
does add in the hardware latency.
I absolutely need to get this latency value from AudioTrack
. Is there any possible way I can do this? I don't care what kind of crazy hack is needed as long as it doesn't require a rooted phone (the resulting code must still be packaged as an app on the market).
There is a method on AudioTrack
called getLatency()
that you can invoke via reflection. For an example, look at Exoplayer or https://developer.amazon.com/docs/fire-tv/audio-video-synchronization.html#section1-2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With