# How to set Fmod Studio Advanced Settings through code?

**URL:** https://qa.fmod.com/t/how-to-set-fmod-studio-advanced-settings-through-code/21612
**Category:** Unity
**Tags:** unity, csharp
**Created:** [May 11, 2024, 12:23pm UTC](https://qa.fmod.com/t/how-to-set-fmod-studio-advanced-settings-through-code/21612 "2024-05-11T12:23:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Hzo420](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/hzo420/32/3827_2.png) [@Hzo420](https://qa.fmod.com/u/Hzo420)
#### Post date: [May 11, 2024, 12:23pm UTC](https://qa.fmod.com/t/how-to-set-fmod-studio-advanced-settings-through-code/21612/1 "2024-05-11T12:23:41Z")

</div>

Greetings,

I’m trying to increase the commandQueueSize using the “setAdvancedSettings” method through the RuntimeManager. Unfortunately, that seems impossible, as the advanced settings must be set before the FMODUnity.System is initialized, and invoking this line:

```auto
RuntimeManager.StudioSystem.setAdvancedSettings(newSettings);

```

Immediately Initializes the RuntimeManager, which in turn initializes the FMODUnity.System.

The only solution I have found is to change the settings in the RuntimeManager.cs, specifically adding these three lines past line 375 (before the studioSystem gets initialized):

```auto
studioSystem.getAdvancedSettings(out FMOD.Studio.ADVANCEDSETTINGS settings);
settings.commandqueuesize = 262144;
studioSystem.setAdvancedSettings(settings);

```

My question is: what’s the proper way to do this? I’d like to avoid changing FMOD classes directly if possible.

Thanks!

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [May 15, 2024, 1:59am UTC](https://qa.fmod.com/t/how-to-set-fmod-studio-advanced-settings-through-code/21612/2 "2024-05-15T01:59:50Z")

</div>

FMOD for Unity supports an optional [Callback Handler](https://www.fmod.com/docs/2.03/unity/examples-callback-handler.html) that can be used to hook into parts of the initialization process. `PreInitialize` looks like what you want, as it gets called after `Studio.setAdvancedSettings` and before `StudioSystem.initialize`.

---

<div class="post-metadata">

### Author: ![Hzo420](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/hzo420/32/3827_2.png) [@Hzo420](https://qa.fmod.com/u/Hzo420)
#### Post date: [May 17, 2024, 7:28pm UTC](https://qa.fmod.com/t/how-to-set-fmod-studio-advanced-settings-through-code/21612/3 "2024-05-17T19:28:19Z")

</div>

That did it, thanks!
