I solved the problem and I found a google group on the topic. It was really helpful. Here's the link:
https://groups.google.com/forum/#!topic/android-ndk/O-hufEm20cU
, NDK. Android, STREAM_VOICE .
// Code for working with ear speaker by setting stream type to STREAM_VOICE
SLAndroidConfigurationItf playerConfig;
result = (*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_ANDROIDCONFIGURATION, &playerConfig);
SLint32 streamType = SL_ANDROID_STREAM_VOICE;
result = (*playerConfig)->SetConfiguration(playerConfig, SL_ANDROID_KEY_STREAM_TYPE, &streamType, sizeof(SLint32));