Voice communication at 8KHz sampling rate for all android device using OpenSL

95 views
Skip to first unread message

Reaz Murshed Masud

unread,
Mar 16, 2014, 12:21:51 AM3/16/14
to andro...@googlegroups.com
I need to create a VOIP app and I'm using OpenSL ES. I need to capture and play pcm audio data at 8KHz sampling rate for all android devices. But, when i capture audio at sampling rate 8KHz and play it at the same time (voice communication), it produces noise and the audio is distorted for some devices like Samsung Galaxy S3, S4 etc. I know, there's a specific preferred sampling rate for each device and I want to know is there any workaround or any way to work with 8KHz sampling rate only without any distortion? I tried increasing buffer size and many other things but failed to find an optimum and generic solution. I need audio data sampled at 8KHz for my encoder and decoder.
I took re-sampling audio data before it is passed to my encoder or decoder as my second thought, but its not the solution i'm looking for.
I found CSipSimple used OpenSL and I went through some of their codes too. But, yet I couldn't find a solution and may be I failed to understand where to concentrate. I'm stuck here!

Glenn Kasten

unread,
Mar 20, 2014, 12:34:57 PM3/20/14
to andro...@googlegroups.com
If you are restricted to 8 kHz, and need both output and input, I recommend using the SDK APIs instead.
You will not get the output latency reductions of NDK output at native sample rate,
but I think you'll find the SDK APIs easier to work with: search for AudioTrack and AudioRecord in SDK.
Reply all
Reply to author
Forward
0 new messages