From the document in r6 (docs/opensles/chart1.png), it looks we can get/set the volume of AudioPlayer object via VolumeItf.
The result is however, the return value of GetMaxVolumeLevel() is always 0, thus I canot set the volume anything but 0.
Am I missing something?
I tweaked the sample code (samples/native-audio) to get/set the volume like:
const SLInterfaceID ids[2] = {SL_IID_SEEK, SL_IID_VOLUME};
const SLboolean req[2] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE};
(*engineEngine)->CreateAudioPlayer(engineEngine, &fdPlayerObject, &audioSrc, &audioSnk, 2, ids, req);
(*fdPlayerObject)->Realize(fdPlayerObject, SL_BOOLEAN_FALSE);
SLVolumeItf volumeIf;
(*fdPlayerObject)->GetInterface(fdPlayerObject, SL_IID_VOLUME, &volumeIf);
SLmillibel maxVolume;
(*volumeIf_)->GetMaxVolumeLevel(volumeIf, &maxVolume);
maxVolume => 0
I'm on NDK r6, Nexus S, OS 2.3.4.
Thanks in advance,