Answered
0
0
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);
  • You must to post comments
Best Answer
0
0

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.

  • You must to post comments
Best Answer
0
0

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.

  • You must to post comments
0
0

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

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.