For using stream type STREAM_VOICE_CALL for the active source you can use this code:
SLAndroidConfigurationItf playerConfig;
res = (*sles_player_)->GetInterface(sles_player_,
SL_IID_ANDROIDCONFIGURATION, &playerConfig);
if (res != SL_RESULT_SUCCESS) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" failed to get SL_IID_ANDROIDCONFIGURATION");
return -1;
}
int32_t streamType = SL_ANDROID_STREAM_VOICE;
res = (*playerConfig)->SetConfiguration(playerConfig,
SL_ANDROID_KEY_STREAM_TYPE, &streamType, sizeof(int32_t));
if (res != SL_RESULT_SUCCESS) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" failed to set SL_ANDROID_STREAM_VOICE");
return -1;
}
works for me...
Naaman