// Try to be as optimal as possible for the internal format. If mini_al does not support a format we will fall back to f32.
pDecoder->internalFormat=mal_format_unknown;
switch(pWav->translatedFormatTag){
caseDR_WAVE_FORMAT_PCM:
{
if(pWav->bitsPerSample==8){
pDecoder->internalFormat=mal_format_s16;
}elseif(pWav->bitsPerSample==16){
pDecoder->internalFormat=mal_format_s16;
}elseif(pWav->bitsPerSample==32){
pDecoder->internalFormat=mal_format_s32;
}
}break;
caseDR_WAVE_FORMAT_IEEE_FLOAT:
{
if(pWav->bitsPerSample==32){
pDecoder->internalFormat=mal_format_f32;
}
}break;
caseDR_WAVE_FORMAT_ALAW:
caseDR_WAVE_FORMAT_MULAW:
caseDR_WAVE_FORMAT_ADPCM:
caseDR_WAVE_FORMAT_DVI_ADPCM:
{
pDecoder->internalFormat=mal_format_s16;
}break;
}
if(pDecoder->internalFormat==mal_format_unknown){
pDecoder->internalFormat=mal_format_f32;
}
pDecoder->internalChannels=pWav->channels;
pDecoder->internalSampleRate=pWav->sampleRate;
mal_get_default_device_config_channel_map(pDecoder->internalChannels,pDecoder->internalChannelMap);// For WAV files we are currently making an assumption on the channel map.