Open chrbsg opened 4 years ago
OpenSL ES does not support setting the device menu.
But there are two oboe:Usages that map to that OpenSL stream:
case Usage::VoiceCommunication:
case Usage::VoiceCommunicationSignalling:
openslStream = SL_ANDROID_STREAM_VOICE;
It gets set here: https://github.com/google/oboe/blob/eecaf3e26af7496c6824dcaf83ac270fc4d7fbf5/src/opensles/AudioOutputStreamOpenSLES.cpp#L196
So if we add a Usage menu to the demo then it should work.
When OpenSL ES is being used we should disable the output devices which it isn't possible to select. We can use SL_ANDROID_STREAM_VOICE
to select the earpiece speaker.
According to https://stackoverflow.com/questions/21576739/how-to-configure-opensl-to-work-with-ear-speaker-other-than-main-speaker-or-head and https://groups.google.com/forum/#!topic/android-ndk/O-hufEm20cU
Earpiece speaker can be selected by using option SL_ANDROID_STREAM_VOICE in OpenSL config.
It would be useful to somehow expose this in the audio demos (output device dropdown?) to demonstrate playback with OpenSL through that speaker.