Questions tagged [opensl]

OpenSL ES™ is a royalty-free, cross-platform, hardware-accelerated audio API tuned for embedded systems.

193 questions
1
vote
0 answers

How to change microphone for recording when handsfree is connected in Samsung devices?

I'm working with OpenSL_ES in Android, and having some issues with the mic source selection in Samsung devices when I connect earphones with handsfree. The problem is that no matter what mic source I set in OpenSL_ES, the gain configuration changes…
alexm
  • 1,285
  • 18
  • 36
1
vote
1 answer

How to play multiple songs together in sync?

I want to play 5 songs together without any miss sync. I've taken reference from the below link with use of NDK: https://github.com/googlesamples/android-ndk I'm creating 5 instance for player and playing songs but on some devices songs are not…
Jatin
  • 1,650
  • 3
  • 17
  • 32
1
vote
0 answers

How to implement call recording with android ndk

I want to record calls with android NDK. Previously i was using sdk and recording calls but in few specific phones and new released phones at (API Level 24/Nougat) or higher call isn't recording.
Ace
  • 77
  • 7
1
vote
1 answer

How do I playback an audio stream (not by URL)?

Say, I have an InputStream, providing audio/mpeg (or audio/aacp) - a Shoutcast radio. Could somebody please show me a code example to playback such a stream? I searched all over the internet, and it looks like the android.media.MediaPlayer can't…
Eugene
  • 176
  • 3
  • 14
1
vote
0 answers

Enqueued sound data is not playing using OpenSL on Android

I am working on a project using OpenSL for Android and I came on a problem. In this following case, the wave data enqueued will be skipped in rare occasions. SLObjectItf mpSLPlayerObject; SLPlayItf    mpPlayItf; SLAndroidSimpleBufferQueueItf…
1
vote
0 answers

Android OpenSL ES, how to choose speaker

Does anyone know how to play the sound through the speaker that we normally use during the phone conversation (not the loud speaker, but the ear speaker)? I have developed the app similar to Skype and my only problem is that when the sound is played…
Alex Joly
  • 45
  • 4
1
vote
0 answers

Android:About the sample rate when recording when using AudioRecord and OpenSL ES

I am investigating the audio recording using AudioRecord and OpenSL ES, and I find some confusion about the sample rate when reading the doc. About the AudioRecord, it says the sample rate expressed in Hertz. 44100Hz is currently the only rate that…
mianlaoshu
  • 2,342
  • 3
  • 27
  • 48
1
vote
1 answer

Sound glitch on Android OpenSLES buffered queue

I've implemented an OpenSLES buffered queue following the example here: https://github.com/googlesamples/android-ndk/blob/master/native-audio/app/src/main/cpp/native-audio-jni.c However when I enqueue my sound and it's (implicitly) played, I can…
FloFu
  • 609
  • 1
  • 5
  • 21
1
vote
0 answers

How to acquire microphone audio via OPEN SL ES from a connected Bluetooth headset's microphone?

I'm working an Android project about record and play from a connected Bluetooth headset's microphone. I need to use native code (Open SL ES). I referred this answer of Hoan Nguyen to write for connection Bluetooth (by Java). My results: If I record…
1
vote
1 answer

Is there any way to sample audio using OpenSL on android with different sampling rates and buffer sizes?

I have downloaded the audio-echo app from the android NDK portal for opensl. Due to the lack of documentation I'm not able to identify how to change the sampling rate and buffer size of the audio in and out. If anybody has any idea on how…
Abhishek Sehgal
  • 590
  • 4
  • 16
1
vote
1 answer

Android: Initial audio processing method call takes a long time

I'm getting a very peculiar issue with my audio callbacks in my Android app (that's using NDK/OpenSL ES). I'm streaming audio output at 44.1 kHz and 512 frames (which gives me a callback time of 11.6 ms). In the callback, I'm synthesizing a couple…
yun
  • 1,243
  • 11
  • 30
1
vote
0 answers

Andrioid # of supported OpenSL AudioBuffers in Marshmallow (API23)

I have an Android app which uses OpenSL ES for audio. It runs correctly in API17 through API 22. While developing the app, I read somewhere that although OpenSL supports up to 32 objects (platform dependent), Android supports only 11. And so, I…
dave
  • 11
  • 4
1
vote
1 answer

OpenSL ES precise start of playback

I am working on an Android app that uses OpenSL ES for audio input/output. However, I've been struggling to come up with a solution that would enable to start playback at a precisely given time (e.g. I want to start playing in exactly 3.2 seconds…
Andres Traumann
  • 144
  • 1
  • 8
1
vote
0 answers

Error when running initAudio

I've been building an android app that will output a single tone when opened (as a test for libpd), and I am encountering an error with OpenSL when I initialize and run PdService.initAudio and PdService.startAudio() W/libOpenSLES: class OutputMix…
1
vote
1 answer

Android low latency OpenSLES: Recorder stop working on audio route change to speaker

I'm developing VoIP application using low latency fast path,the problem is that when I change the audio route to speaker I noticed that the recorder callback fires every 100ms instead of 5ms as it should work and the following error is…