Questions tagged [opensl]

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

193 questions
3
votes
1 answer

What does (void)result; mean in android OpenSL example?

In the android implementation of OpenSL ES, the following example code can be found in the android-ndk /samples/native-audio/jni/native-audio-jni.c SLresult result; result = slCreateEngine(&engineObject, 0, NULL, 0, NULL,…
HYS
  • 771
  • 6
  • 11
3
votes
1 answer

Android Opensles resampling PCM with FFmpeg

I'm trying to play an audio stream with ffmpeg and opensles in android. And the problem seems to be when passing the decoded and resampled frames from ffmpeg to opensles as the sound I can hear sounds robotic and has scratching. The decoded frames…
3
votes
2 answers

Playing PCM WAVE sound from memory with OpenSL on Android

I'm trying to set up OpenSL AudioPlayer to use memory I've allocated to playback a wav file. I want to do this so I can have multiple AudioPlayers that share the same data and conserve memory. I've tried to give openSL the entire file and tell it…
agoaj
  • 369
  • 6
  • 13
3
votes
1 answer

OpenSL, playing different sound clips at the same time with android ndk?

I am wanting use the native android ndk and OpenSL ES to play multiple sounds simultaneously. I've taken a look at the native-audio example in the ndk but haven't been able to figure out how to generalize it so that I can play different audio…
markt1964
  • 2,638
  • 2
  • 22
  • 54
3
votes
1 answer

Android - OpenSL ES high microphone gain

I am having a similar problem described in this link: RecorderObject in OpenSL does not implement the interface to set the volume or configure on Android The problem being that I can't set the volume on the recorder because getting the volume…
joshliebe
  • 35
  • 1
  • 6
3
votes
1 answer

Hook simple audio filter to music playing under android

I'm trying to build an app that uses a digital filter to process audio playing from other (stock music player and spotify etc) apps. So far I've been able to create the filter for audio input from the mic in OpenSL ES. The filtered audio is then…
daker
  • 3,430
  • 3
  • 41
  • 55
3
votes
2 answers

play audio in real-time using opensl es and the android ndk

What I would like to do is record a voice, process it like adding some effect to the recorded audio, and then replay it as fast as possible using opensl. I'm having trouble finding information on the net about doing something like this, so I…
iedoc
  • 2,266
  • 3
  • 30
  • 53
3
votes
1 answer

Android NDK, OpenSL ES - Knowning when a buffer got filled

If I enqueue a buffer for recording into the buffer queue - is there a way of knowing when that buffer was actually filled, so I can use it ? Likewise, is there a way of knowing when a buffer was played? For context: I'm tinkering with the NDK…
user1847129
  • 1,010
  • 2
  • 9
  • 21
3
votes
1 answer

How can I specify the input source for the AudioRecorder object?

I'm porting an audio capture loop from Java (using AudioRecord class) to a native library using OpenSL. The reason for this is that after profiling, the capture loop is consuming in our test phones around 2% less CPU in OpenSL. That is a…
user1222021
3
votes
1 answer

OpenSL ES can not play audio on Android emulator

I decode amrnb to PCM, then put right pcm buffer to Enqueue buffer (I'm sure PCM data is right), but no sound is heard. And when feeding buffer, log outputs: /AudioTrack(14857): obtainBuffer timed out (is the CPU pegged?) My code is below, and my…
3
votes
1 answer

Underrun notification in Android ndk

I am trying to create a streaming based audio application on Android using NDK (which inturn used open SLES). I have the basic streaming setup working. I need to know how underruns(or overruns) are handled in Android ? How are error callbacks…
Shrish
  • 739
  • 5
  • 15
2
votes
2 answers

OpenSL ES crashes randomly on Samsung Galaxy SII (GT-I9100)

I'm using OpenSL ES on android. It seems to work pretty well. However, after a while my app crashes on Samsung Galaxy SII (GT-I9100). Other phones (ZTE Blade, Galaxy Nexus, HTC evo 3D) don't seem to crash this way. Here's the log from logcat,…
Habba
  • 1,179
  • 2
  • 13
  • 32
2
votes
1 answer

"No more track names available" when using OpenSL ES

I'm using OpenSL ES and my android app has need for multiple channels, so I create multiple player-objects (plus one player-object for each of mp3-files I need to play). This works fine for one application, but when I ran another app I've created,…
Habba
  • 1,179
  • 2
  • 13
  • 32
2
votes
1 answer

How to avoid the android opensl es crash when destroy the engine object?

I got a opensl es crash in android 8.1.0. The related code: TEResult SLESAudioEngine::release(TEMsg *pMsg) { TEResult ret; SLuint32 playState = 0; (*bqPlayerPlay)->GetPlayState(bqPlayerPlay, &playState); LOGE(LOG_TAG, "%s, %d, %d",…
Jerikc XIONG
  • 3,517
  • 5
  • 42
  • 71
2
votes
0 answers

How to add OpenSL ES library as a dependency to a project?

I have started adding OpenSL ES code to my Dynamic Shared Library project, but when I try to compile it, linker says: undefined reference to 'slCreateEngine' I can see OpenSLES.h in "External Dependencies", but linker cannot see it somehow. This…
FCin
  • 3,804
  • 4
  • 20
  • 49