0

Is it possible to get available audio endpoints (earpiece, speakerphone, wired headset, bluetooth headset) via the openSL ES API for Android 4.3 ?

Or is all that stuff done at the Java level ?

Current situation is that I have implemented an openSL ES audio driver. The driver does nothing but receiving mic packets from the default mic and delivering speaker packets to the default speaker endpoint.

If possible, I would like to create a couple of extra functions in my code. One to inquire about endpoints and another one to set the endpoint.

user1884325
  • 2,530
  • 1
  • 30
  • 49

1 Answers1

1

Is it possible to get available audio endpoints (earpiece, speakerphone, wired headset, bluetooth headset) via the openSL ES API for Android 4.3 ?

You can give hints about how you want the audio to be routed, by using different audio stream types, and by using some of the AudioManager methods (like setBluetoothScoOn and setSpeakerphoneOn). But in the end it's up to the OEM to decide how to route the audio in any given situation.

Or is all that stuff done at the Java level ?

The routing policy is implemented at the native level. Where you find that code depends on which platform you're working with, but on many of Qualcomm's platforms you'll find it under hardware/qcom/audio/alsa_sound/.

Michael
  • 57,169
  • 9
  • 80
  • 125