Disable PCM-8 output when not using DirectSound

- PCM-8 sounds like garbage with WASAPI and WaveOut, so force anything not
  DirectSound to use PCM-16 if PCM-8 is selected.
This commit is contained in:
Randy Heit 2015-04-22 18:32:45 -05:00
parent f7bd3acec4
commit dba76c1aea

View file

@ -895,6 +895,15 @@ bool FMODSoundRenderer::Init()
// Set software format // Set software format
eval = Enum_NumForName(SoundFormatNames, snd_output_format); eval = Enum_NumForName(SoundFormatNames, snd_output_format);
format = eval >= 0 ? FMOD_SOUND_FORMAT(eval) : FMOD_SOUND_FORMAT_PCM16; format = eval >= 0 ? FMOD_SOUND_FORMAT(eval) : FMOD_SOUND_FORMAT_PCM16;
if (format == FMOD_SOUND_FORMAT_PCM8)
{
// PCM-8 sounds like garbage with anything but DirectSound.
FMOD_OUTPUTTYPE output;
if (FMOD_OK != Sys->getOutput(&output) || output != FMOD_OUTPUTTYPE_DSOUND)
{
format = FMOD_SOUND_FORMAT_PCM16;
}
}
eval = Enum_NumForName(ResamplerNames, snd_resampler); eval = Enum_NumForName(ResamplerNames, snd_resampler);
resampler = eval >= 0 ? FMOD_DSP_RESAMPLER(eval) : FMOD_DSP_RESAMPLER_LINEAR; resampler = eval >= 0 ? FMOD_DSP_RESAMPLER(eval) : FMOD_DSP_RESAMPLER_LINEAR;
// These represented the frequency limits for hardware channels, which we never used anyway. // These represented the frequency limits for hardware channels, which we never used anyway.