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

前端 未结 1 1525
萌比男神i
萌比男神i 2021-01-14 04:23

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 s

相关标签:
1条回答
  • 2021-01-14 05:04

    Here's how I solved my problem:

    I was working on audio streaming for Android using OpenSL ES and this tutorial helped me a lot. I followed the instructions here and got the thing working. Then i found audio streaming with this approach doesn't work very well for some devices (mostly samsung devices). I tried many things like increasing buffer size, disabling environmental reverb etc etc. I found this answer very useful for improving streaming performance.

    Finally, I found the audio is distorted because of theadlocks I had to use for synchronizing the buffer switches. Using lock free structure is suggested for better audio performance. Then I went with another approach of Victor Lazzarini which is a lock free Audio IO. This article of Lock-free audio IO with OpenSL ES on Android helped a lot to implement a lock free structure along with a better audio performance.

    0 讨论(0)
提交回复
热议问题