opensl es and multi-channel audio


#1

Greetings,

I am trying to configure OpenSL ES for playing 5.1 multi-channel audio(surround). With the following: -

SLDataFormat_PCM pcmFmtSrnd = { SL_DATAFORMAT_PCM, 6, SL_SAMPLINGRATE_48,
SL_PCMSAMPLEFORMAT_FIXED_16,
SL_PCMSAMPLEFORMAT_FIXED_16,
SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT |
SL_SPEAKER_FRONT_CENTER | SL_SPEAKER_LOW_FREQUENCY |
SL_SPEAKER_BACK_LEFT | SL_SPEAKER_BACK_RIGHT,
SL_BYTEORDER_LITTLEENDIAN
};

I keep getting a ‘SL_RESULT_CONTENT_UNSUPPORTED’ when CreateAudioPlayer() is called.

Can someone shed some light on why I might be hitting the above error condition? Isn’t multi-channel surround supported on OpenSL ES?

Thanks in advance.

Warm regards,

mraman


#2

Hi mraman,

OpenSL ES does support multi-channel surround sound, but the device/implementation you are working with might not. SL_RESULT_CONTENT_UNSUPPORTED lets you know that the device does not support the content which you are specifying.

I recommend that you start with a minimal number of channels and see if the content is supported. If it is, add one channel at a time to see which one the device doesn’t support. If the content isn’t accepted, then you need to look for issues elsewhere.

Best,

Erik