Hardcoding setSoftwareFormat/setDSPBufferSize safe?

Is it safe to hardcode the values for System::setDSPBufferSize and System::setSoftwareFormat?

mSystem->setDSPBufferSize(512, 4);
mSystem->setSoftwareFormat(44100, FMOD_SPEAKERMODE_DEFAULT, 0);

On my Android test devices it sets the frequency to around 22khz if I do not call setSoftwareFormat, which has too high a latency. The calls above work fine on the devices I’ve tried, but I noticed if I set the frequency to some strange values the audio doesn’t play. Is there a proper way to check what allowable values I can use in the above calls? Will the values I’ve chosen always work or does it depend on the device? (note I’ll be eventually porting it to iOS as well).

If you set the rate to something other than that of the hardware device (ie System::getDriverInfo) then the mixer will have to resample its output in some cases, and will incur 1 block’s worth of latency usually.

22khz by default is just to reduce CPU usage on low quality speakers, but you’re fine to increase it.