# Hardcoding setSoftwareFormat/setDSPBufferSize safe?

**URL:** <https://qa.fmod.com/t/hardcoding-setsoftwareformat-setdspbuffersize-safe/11667>\
**Category:** FMOD Engine\
**Created:** [October 11, 2014, 10:22pm UTC](https://qa.fmod.com/t/hardcoding-setsoftwareformat-setdspbuffersize-safe/11667 "2014-10-11T22:22:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitnainartinarian](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@Mitnainartinarian](https://qa.fmod.com/u/Mitnainartinarian)\
**Post date:** [October 11, 2014, 10:22pm UTC](https://qa.fmod.com/t/hardcoding-setsoftwareformat-setdspbuffersize-safe/11667/1 "2014-10-11T22:22:07Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [October 12, 2014, 10:50pm UTC](https://qa.fmod.com/t/hardcoding-setsoftwareformat-setdspbuffersize-safe/11667/2 "2014-10-12T22:50:25Z")

</div>

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.
