title: OpenSL ES decode 24bit FLAC
body: <p>I am trying to decode a FLAC file with 24bit sample format using OpenSL ES on Android. Originally, I had my <code>SLDataFormat_PCM</code> for the <code>SLDataSink</code> setup like this.</p>
  
  <pre><code>_pcm.formatType = SL_DATAFORMAT_PCM;
  _pcm.numChannels = 2;
  _pcm.samplesPerSec = SL_SAMPLINGRATE_44_1;
  _pcm.bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16;
  _pcm.containerSize = SL_PCMSAMPLEFORMAT_FIXED_16;
  _pcm.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT;
  _pcm.endianness = SL_BYTEORDER_LITTLEENDIAN;
  </code></pre>
  
  <p>This is working well for basically any data format. Luckily the <code>samplesPerSec</code> is not respected (I don't want resampling).</p>
  
  <p>Now I want to support the full bit-depth of a FLAC file with 24bit samples. When using this format, it apparently performs a bit-depth conversion, because once I load the file, and then check the <code>ANDROID_KEY_PCMFORMAT_BITSPERSAMPLE</code> info, it is 16.</p>
  
  <p>When I put <code>bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_24;</code> or <code>SL_PCMSAMPLEFORMAT_FIXED_32</code>, then OpenSL ES rejects it</p>
  
  <pre><code>E/libOpenSLES(22706): pAudioSnk: bitsPerSample=32
  W/libOpenSLES(22706): Leaving Engine::CreateAudioPlayer (SL_RESULT_CONTENT_UNSUPPORTED)
  </code></pre>
  
  <p>Any idea how this is meant to work? Is Android currently restricted to 16 bit int only?
  I would also accept 32bit float, but I don't suppose that will work either.</p>