Question

I am having a problem with the volume interface in OpenSL on Android. When I attempt to create an Output Mix object with the volume interface like this:

const SLInterfaceID interfaceIDs[1]={SL_IID_VOLUME};
const SLboolean interfaceRequirements[1]={SL_BOOLEAN_TRUE};

SLresult result=(*engineInterface)->CreateOutputMix(engineInterface,&outputObject,1,interfaceIDs,interfaceRequirements);

result comes back as SL_RESULT_FEATURE_UNSUPPORTED even though the volume interface is listed as mandated in the spec.

If I change the 1 to 0 so that it ignores the requested interfaces, the output mix object is created, but obviously fails when attempt to GetInterface(outputObject,SL_IID_VOLUME,&volumeInterface).

The only mention of the volume interface I see here is related to volume calculations when using EnableStereoPosition.

Was it helpful?

Solution

Android does not support the full OpenSL ES specification. If you look at the table in your second link, it shows that Android only supports Volume with Audio Player, but not Recorder, Engine or Output Mix. This feature is, indeed, unsupported.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top