Bug - FMOD Doesn't change blocksize of DSP buffer if Samplerate is not 48kHz

FMOD_RESULT result = FMOD::System_Create(&m_FMODSystem);      // Create the main system object.
if (FMOD_OK != result)
	return(E_FAIL);

int iOSSampleRate(48000);
if (!GetOSSampleRate(iOSSampleRate)) { // Increasing Sample Rate introduces clicks pops strange sounds

	result = m_FMODSystem->getSoftwareFormat(&iOSSampleRate, 0, 0);
	if (FMOD_OK != result)
		iOSSampleRate = 48000;
}
m_iOSSampleRate = iOSSampleRate;

// Adjust Mixer Size, needed to compenstate for different OS Sample Rates to Maintain a 21.33334 ms update interval for the FMOD Mixer. FMOD does NOT do This!!
double const fMinDesiredMixerUpdate(21.33334);
unsigned int blocksize(0);
int numblocks;
result = m_FMODSystem->getDSPBufferSize(&blocksize, &numblocks);
if (FMOD_OK != result)
	return(E_FAIL);

unsigned int const newBlockSize = ((double)m_iOSSampleRate * fMinDesiredMixerUpdate) / 1000.0;

result = m_FMODSystem->setDSPBufferSize(newBlockSize, numblocks);
if (FMOD_OK != result)
	return(E_FAIL);

result = m_FMODSystem->getDSPBufferSize(&blocksize, &numblocks);
if (FMOD_OK != result)
	return(E_FAIL);

Actually, am I maybe missing the point?

Does FMOD Studio use WASAPI Shared or Exclusive Mode by default now?

According to MSDN, WASAPI Shared requires the application to provide the audio data in the same format as the OS system rate configured in the audio control panel.

So does FMOD internally resample to the system rate before sending the audio data to WASAPI Output?

I’m trying to match the internal mixer samplerate of FMOD to the System rate, and if FMOD already does this then I no longer need to do this so clarification would be great.

Thanks,
Jason

Does FMOD Studio use WASAPI Shared or Exclusive Mode by default now?

Shared.

So does FMOD internally resample to the system rate before sending the audio data to WASAPI Output?

Yes the FMOD mixer sample rate is independent of the system output samplerate, it will be resampled at the output.

FMOD handles all the WASAPI stuff, you don’t need to worry about that. You can just initialize FMOD with default settings and start playing sounds. There are examples in that come with the API which demonstrate usage. The PlaySound example is a good place to start.

To answer your initial question, no FMOD does not adjust the buffer size depending on the sample rate, this is by design. You have the option of specifying both, so if you desire a certain buffer time you can calculate the required size to achieve that yourself.