OpenSL ES™ is a royalty-free, cross-platform, hardware-accelerated audio API tuned for embedded systems.
Questions tagged [opensl]
193 questions
5
votes
0 answers
Android OpenSL ES AAC decoder
Is there any example source code how to decode AAC frames into PCM using Android OpenSL ES AAC decoder code? I need to decode AAC frame (with or without ADTS header) stored in memory buffer into PCM.

user1744147
- 1,099
- 13
- 30
5
votes
4 answers
RecorderObject in OpenSL does not implement the interface to set the volume or configure on Android
I tried to get the SLDeviceVolumeItf interface of the RecorderObject on Android but I got the error: SL_RESULT_FEATURE_UNSUPPORTED.
I read that the Android implementation of OpenSL ES does not support volume setting for the AudioRecorder. Is that…

kingston
- 11,053
- 14
- 62
- 116
4
votes
1 answer
OpenSL Tutorial ES for PC (Not Android)
I'm looking to start learning the basics of OpenSL ES without getting into the whole Android business. Is there no tutorials describing the process of setting up OpenSL, as there are for OpenAL?
I am using Ubuntu.

IamPolaris
- 1,021
- 2
- 10
- 19
4
votes
2 answers
Audio Library for Windows, Mac & iOS? OpenAL/OpenSL
I write an Desktop/iOS Game with OpenGL and want to play audio files (mp3 or wav). I've worked already with CoreAudio and AudioQueues, but now I need something that works also with Windows (and maybe Linux).
I've seen so far:
OpenAL
OpenSL
I only…

Constantin
- 8,721
- 13
- 75
- 126
4
votes
1 answer
How to configure OpenSL to record voice call
I'm working on a call recorder app using MediaRecorder VOICE_CALL audio source, In some marshmallow devices it's crashing, then I changed source to MIC here incoming voice is not getting recorded. Due to this java limitation now I'm working on…

Bharath Kumar
- 534
- 1
- 7
- 18
4
votes
1 answer
Android : How to get the preferred (native) audio buffer size and audio sample rate in C/C++?
To get the preferred audio buffer size and audio sample rate for a given Android device, you can execute the following Java code:
// To get preferred buffer size and sampling rate.
AudioManager audioManager = (AudioManager)…

user1884325
- 2,530
- 1
- 30
- 49
4
votes
0 answers
Slow OpenSL ES performance when connected to bluetooth headset?
I'm using OpenSL ES in Android to decode and play an mp3 file using an AndroidSimpleBufferQueue. This works fine until you connect a bluetooth headset, at which point performance comes down to a crawl, and playback is very slow and stutters.
Any…

Jens Zalzala
- 2,546
- 1
- 22
- 28
4
votes
1 answer
attachAuxEffect and OpenSL ES
When using AudioTrack in Android you can call attachAuxEffect to attach an audio effect. Is there a similar method or approach when using OpenSL ES for audio playback? I can't seem to find a similar method.

William Seemann
- 3,440
- 10
- 44
- 78
4
votes
0 answers
Android OpenSL Buffer Timeout
For the last few weeks I'm trying to learn more about OpenSL. Wrote a simple music player, and it worked really well.
On some devices, I'm receiving an error message and the OpenSL thread gets locked, which also locks the UI thread for some reason…

emrahgunduz
- 1,404
- 1
- 13
- 26
4
votes
1 answer
Voice communication at 8KHz sampling rate for all android device using OpenSL
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…

Reaz Murshed
- 23,691
- 13
- 78
- 98
4
votes
1 answer
What is SLDataLocator_AndroidSimpleBufferQueue (Android 4.3)?
What does the '2' stand for in the following :
SLDataLocator_AndroidSimpleBufferQueue loc_bq =
{SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2};
From what I've read, it is the number of buffers.
Why 2? Why not just 1 ? And if 2 is better, why not 10…

user1884325
- 2,530
- 1
- 30
- 49
4
votes
1 answer
How to convert human voice to musical note in Android?
I am trying to store analog data from Android mike to musical notes such as a4,b1.. I tried working with aubio.org . But its written in C. Is there any other open source for doing it. If aubio is the way to do it how can i do it.

Ranjithkumar
- 697
- 6
- 16
4
votes
2 answers
Native sound library on Android that can actually change pitch?
I'm confused as to how to set pitch natively on Android. I tried altering the native-sound sample from the NDK which uses OpenSL ES, but I get a SL_RESULT_FEATURE_UNSUPPORTED for pretty much anything related to pitch upon requesting the interface. …

Kalen
- 3,106
- 8
- 29
- 42
4
votes
1 answer
playing a MP3 file android NDK using openSL from memory
I have my android app where data is packed using FileWrap. The thing is I want to wrap the mp3 data into the android file and play from that memory. I have checked the nativeaudio example in NDK which shows how to play MP3 as an asset or as a…

madan kandula
- 460
- 5
- 22
4
votes
4 answers
How to measure audio latency using OpenSL on Android?
I use OpenSL for recording and playing audio on Android. Could you please advice me how to measure latency, in order to find the optimal audio configuration (buffers, sample rate).
Thank you in advance!

Taras
- 2,526
- 3
- 33
- 63