This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Android and the fly likes Audio Latency Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Audio Latency" Watch "Audio Latency" New topic

Audio Latency

Sam Kostler

Joined: Jan 20, 2013
Posts: 4
After a false start and going back to the beginning I'm comfortably getting code to run but I'm running into a problem with what I need my program to do and whether Android and the available hardware are able to do it.

I'm looking to input and output an audio stream and get under 25ms (perhaps 50ms if I really push it) round trip from mic to speaker combined with the ability to set the delay from 25ms (or 50ms) to 300ms with +-1ms granularity. I'm getting far too high of latency on my Gingerbread (2.3.5) phone (Samsung Exhibit II 4g - SGH-T679) using AudioTrack() and AudioRecord(). I've looked into OpenSL and from what I've read I wouldn't be able to get down to an acceptable latency. I've read that with Android 4.1 and OpenSL the latency is significantly reduced, but there seems to be some question as to the amount of reduction.

Does anyone have any advice or information they can point me to?

If I'm just doing it wrong can someone set me straight on how to achieve the latency I need?

If there's no other way I'm willing to put perhaps $250 towards a new device if it's a certainty that I can hit my benchmarks with it, is there a device someone can recommend which would work for what I'm doing?

I agree. Here's the link:
subject: Audio Latency
It's not a secret anymore!