Change Master Output from stereo to Mono

Hi,
I want to create a button in Unity to switch (toggle) between stereo and mono output. Is this possible via c#?

Thanks! :slight_smile:

Hi, It looks like you can do this by setting the software format from the core system.

var core = FMODUnity.RuntimeManager.CoreSystem;
core.setSoftwareFormat(0, FMOD.SPEAKERMODE.MONO, 0);

Here’s the page in the documentation: System::setSoftwareFormat

1 Like

Hi, Aishi!! Thanks for your help.

I tried to implement this button, but it’s not working.

I still have doubts related to what comes after FMOD.SPEAKERMODE.STEREO, ____

But anyway, even the mono didn’t work.

Here’s my code:

public void ToggleMonoStereo(bool isMono)
{
    if (!isMono)
    {
        MasterMono();
    }
    else
    {
        MasterStereo();
    }
}


public void MasterMono()
{
    var core = FMODUnity.RuntimeManager.CoreSystem;
    core.setSoftwareFormat(48000, FMOD.SPEAKERMODE.MONO, 0);
}

public void MasterStereo()
{
    var core = FMODUnity.RuntimeManager.CoreSystem;
    core.setSoftwareFormat(48000, FMOD.SPEAKERMODE.STEREO, 1);
}

System::setSoftwareFormat only works when called before the System is initialized. The last parameter is only really relevant for FMOD.SPEAKERMODE.RAW, so you can leave it at 0.

Thanks for the clarification, Mathew!

So it’s not possible to change from stereo to mono during runtime?

Yes and no.

As Mathew said, it’s not possible to change the channel count of your game’s output at runtime without destroying and rebuilding the Studio system.

However, it is possible to make your game switch between outputting stereo format and outputting the same mono signal to both channels by using a combination of sends and return buses. In FMOD Studio:

  1. Create a discrete global parameter with a minimum value of 1 and a maximum value of 2.
  2. Create a group bus routed into your project’s master bus, and name it “Stereo.”
  3. Take all the buses and events currently routed into your master bus, and route them into the Stereo bus.
  4. Create a new return bus routed into your project’s master bus, and name it “Mono.”
  5. Select the “Mono” return bus, and set its output format to mono.
  6. Select the “Stereo” group bus, and add a pre-fader send to the Mono return bus to its signal chain.
  7. Automate both the send and the fader on the global parameter you created back in step 1, such that when the global parameter is set to 1 the send’s volume is 0 dB and the fader’s volume is -oo dB, and when the global parameter is set to 2 the send’s volume is -oo dB and the return’s volume is 0 dB.

This setup will ensure that when the global parameter is set to 2, your game’s output will be stereo; but when the parameter is set to 1, your game’s output will be downmixed to mono and output equally on both channels. This should allow you to treat the output as switching between stereo and mono for most practical purposes.

Alternatively, if you prefer not to use a global parameter, you could instead set the send to -oo dB and the fader to 0 dB, and create a snapshot that sets the send to 0 dB and the fader to -oo dB when an instance of the snapshot is active.

1 Like

Thanks a ton, Joseph!! It worked perfectly for my needs!!