# master volume?

**URL:** <https://qa.fmod.com/t/master-volume/11289>\
**Category:** Unity\
**Created:** [February 10, 2014, 9:15am UTC](https://qa.fmod.com/t/master-volume/11289 "2014-02-10T09:15:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alpacasound](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@alpacasound](https://qa.fmod.com/u/alpacasound)\
**Post date:** [February 10, 2014, 9:15am UTC](https://qa.fmod.com/t/master-volume/11289/1 "2014-02-10T09:15:50Z")

</div>

Hi folks,

I’m new here, trying to get started with fmod in Unity.

I’m looking for the best way to implement a master volume setting in my game, and I see in the C++ documentation that there is a function System::getMasterChannelGroup that looks useful. I don’t see it available in the C# Unity integration though.

What would be the best way to control the master volume in Unity?

Cheers,  
/Mikael

---

<div class="post-metadata">

**Author:** ![Grieva](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Grieva](https://qa.fmod.com/u/Grieva)\
**Post date:** [June 2, 2014, 8:42am UTC](https://qa.fmod.com/t/master-volume/11289/2 "2014-06-02T08:42:10Z")

</div>

Seems the ERRCHECK method is private now?

This code works for me, but doesn’t do error checking.

```auto
	public float volume = 1.0f;
	FMOD.Studio.MixerStrip masterBus;

	void Start()
	{
		FMOD.GUID guid;
		FMOD.Studio.System system = FMOD_StudioSystem.instance.System;
		system.lookupID("bus:/", out guid);
		system.getMixerStrip(guid, FMOD.Studio.LOADING_MODE.BEGIN_NOW, out masterBus);
	}

	void Update()
	{
		masterBus.setFaderLevel(volume);
	}
```

---

<div class="post-metadata">

**Author:** ![Troutmonkey](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@Troutmonkey](https://qa.fmod.com/u/Troutmonkey)\
**Post date:** [April 2, 2014, 6:13am UTC](https://qa.fmod.com/t/master-volume/11289/3 "2014-04-02T06:13:37Z")

</div>

Hi peter,

That solution looks good but is it still current?  
I trying to use it with some minor modifications for the newer version and keep getting null pointers regarding the masterbus.

In Start

```auto
FMOD.GUID guid;
        FMOD.Studio.System system = FMOD_StudioSystem.instance.System;
        FMOD_StudioSystem.ERRCHECK(system.lookupID("/", out guid));
        FMOD_StudioSystem.ERRCHECK(system.getMixerStrip(guid, FMOD.Studio.LOADING_MODE.BEGIN_NOW, out masterBus));
```

On Update:

```auto
FMOD_StudioSystem.ERRCHECK(masterBus.setFaderLevel(volume));
```

I’m also fairly new to FMOD, and after a quick search I have been unable to find the API referenced in your comment.  
Is volume a limited between 0 and 1?

---

<div class="post-metadata">

**Author:** ![Trumkey](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Trumkey](https://qa.fmod.com/u/Trumkey)\
**Post date:** [April 2, 2014, 1:47pm UTC](https://qa.fmod.com/t/master-volume/11289/4 "2014-04-02T13:47:40Z")

</div>

I was struggling with this for a while as well. I figured it had to be something to do with the path because when I debug logged the returned GUID it was all zeroes. Turns out, when you export GUIDs from FMOD Studio the text file output contains all the paths that you need. From this, all bus paths must begin “bus:/”. Similar to the event instance paths beginning with “event:/”.

If you do:

```auto
FMOD_StudioSystem.ERRCHECK(system.lookupID("bus:/", out guid));
```

That should work =)

---

<div class="post-metadata">

**Author:** ![Guest1](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Guest1](https://qa.fmod.com/u/Guest1)\
**Post date:** [February 11, 2014, 2:49am UTC](https://qa.fmod.com/t/master-volume/11289/5 "2014-02-11T02:49:44Z")

</div>

Hi Mikael,

You can retrieve the master bus using the API and control it’s volume directly. The path of the master bus is “/” so the code would look something like this:

```auto
using UnityEngine;
using System.Collections;

public class MasterVolume : MonoBehaviour 
{
	public float volume = 1.0f;
	
	FMOD.Studio.MixerStrip masterBus;
	
	void Start() 
	{
		FMOD.GUID guid;
		FMOD.Studio.System system = FMOD_StudioSystem.instance.System;
		ERRCHECK( system.lookupBusID("/", out guid) );
		ERRCHECK( system.getMixerStrip(guid, FMOD.Studio.LOADING_MODE.BEGIN_NOW, out masterBus) );
	}
	
	void Update()
	{
		ERRCHECK( masterBus.setFaderLevel(volume) );
	}
	
	void ERRCHECK(FMOD.RESULT result)
	{
		FMOD_StudioSystem.ERRCHECK(result);
	}
}
```

---

<div class="post-metadata">

**Author:** ![alpacasound](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@alpacasound](https://qa.fmod.com/u/alpacasound)\
**Post date:** [February 11, 2014, 4:52pm UTC](https://qa.fmod.com/t/master-volume/11289/6 "2014-02-11T16:52:32Z")

</div>

Thanks a lot!
