3

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 implemented ? How to get the time duration for which the AudioPlayer was starving for data ?

Thanks in Advance.

Shrish
  • 739
  • 5
  • 15

1 Answers1

0

After registering your callback using RegisterCallback on your buffer queue's interface, you can call SetCallbackEventsMask having SL_BUFFERQUEUEEVENT_ERROR as one of your mask bits.

I don't know of any straight-forward method of retrieving the duration for which the AudioPlayer has been starving for data, but you could implement that yourself by handling your own timer and using GetState API (also from buffer queue's interface object) in order to obtain the amount of time the buffer queue was empty.

Hope this helps!

Alexandre Bodi
  • 344
  • 2
  • 12