# FMOD Programmer Sound question - emergency!

**URL:** https://qa.fmod.com/t/fmod-programmer-sound-question-emergency/20330
**Category:** Unity
**Created:** [June 20, 2023, 10:45am UTC](https://qa.fmod.com/t/fmod-programmer-sound-question-emergency/20330 "2023-06-20T10:45:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fkkcloud](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/fkkcloud/32/2134_2.png) [@fkkcloud](https://qa.fmod.com/u/fkkcloud)
#### Post date: [June 20, 2023, 10:45am UTC](https://qa.fmod.com/t/fmod-programmer-sound-question-emergency/20330/1 "2023-06-20T10:45:19Z")

</div>

Hello, I am trying to find a way to return 0 on those red segment where there is no volume. and returns 1 where it is above volume 0. Is there any way to do that with FMOD Programmer Sound?

 ![화면 캡처 2023-06-20 034225](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/5/5a55b7b8729ef37fc27539b0dfdc233354e687e3.png)

I implemented Programmer Sound based on this code - [https://www.fmod.com/docs/2.01/unity/examples-programmer-sounds.html](https://www.fmod.com/docs/2.01/unity/examples-programmer-sounds.html)

Thank you in advance-

---

<div class="post-metadata">

### Author: ![fkkcloud](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/fkkcloud/32/2134_2.png) [@fkkcloud](https://qa.fmod.com/u/fkkcloud)
#### Post date: [June 21, 2023, 8:39pm UTC](https://qa.fmod.com/t/fmod-programmer-sound-question-emergency/20330/4 "2023-06-21T20:39:28Z")

</div>

bump

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [June 22, 2023, 4:37am UTC](https://qa.fmod.com/t/fmod-programmer-sound-question-emergency/20330/5 "2023-06-22T04:37:55Z")

</div>

Hi,

An option would be utilizing another one of our scripting examples, [Unity Integration | Scripting Examples - DSP Capture](https://fmod.com/docs/2.02/unity/examples-dsp-capture.html), and combining it with the Programmer Sounds example that you are currently using.

The example creates a DSP ([FMOD API | Core API Reference - DSP](https://fmod.com/docs/2.02/api/core-api-dsp.html)) which is attached to the `Master Channel Group` ([FMOD API | Core API Reference - Channel Group](https://fmod.com/docs/2.02/api/core-api-channelgroup.html)). I would suggest attaching it to the events `channel group` for more accurate results.

The value we are checking is the `mDataBuffer[i]`. There are a couple of checks that we can add that will hopefully improve our results:

1. Rather than just checking `mDataBuffer[i]` for `0`, use a threshold that will hopefully filter out any ambient sound that could still be considered silence.
2. Also adding a sensitivity buffer that will check multiple samples in a row for our threshold will help filter out false zero crossover readings.

Hope this helps!

---

<div class="post-metadata">

### Author: ![fkkcloud](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/fkkcloud/32/2134_2.png) [@fkkcloud](https://qa.fmod.com/u/fkkcloud)
#### Post date: [June 22, 2023, 8:24am UTC](https://qa.fmod.com/t/fmod-programmer-sound-question-emergency/20330/7 "2023-06-22T08:24:23Z")

</div>

Hello there,

So, in order to get a specific event’s volume I assume I need to grab its Group’s ChannelGroup?

So I have group as below - is that my “channel group”?

 ![1](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/d3383eb9c249b5869e62616cf28248494fe20ae3.png)

Then, I copied its path:  
 ![2](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/d04f8e1f01d85d3a2e211015a29e12b6bcd7ec64.png)

which is **“bus:/VO”**.

The, I tried to get

```auto
var bus = RuntimeManager.GetBus("bus:/VO");
            if (bus.getChannelGroup(out var channelGroup) == FMOD.RESULT.OK)
            {
                if (FMODUnity.RuntimeManager.CoreSystem.createDSP(ref desc, out mCaptureDSP) == FMOD.RESULT.OK)
                {
                    if (channelGroup.addDSP(0, mCaptureDSP) != FMOD.RESULT.OK)
                    {
                        Debug.Log("FMOD: Unable to add mCaptureDSP to the master channel group");
                    }
                }
                else
                {
                    Debug.Log("FMOD: Unable to create a DSP: mCaptureDSP");
                }
            }
            else
            {
                Debug.Log("FMOD: Unable to create a master channel group: masterCG");
            }

```

and it goes to “Debug.Log(“FMOD: Unable to create a master channel group: masterCG”);”…  
Then, it showed " ERR\_STUDIO\_NOT\_LOADED" code for the result.

I am using code from here: [https://www.fmod.com/docs/2.01/unity/examples-dsp-capture.html](https://www.fmod.com/docs/2.01/unity/examples-dsp-capture.html)

Please help me.

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [June 23, 2023, 5:02am UTC](https://qa.fmod.com/t/fmod-programmer-sound-question-emergency/20330/8 "2023-06-23T05:02:57Z")

</div>

Hi,

The issue is the `VO` bus’ `channel group` won’t be created until there is an event or sound being played through it.

There are two options, waiting to add the DSP after the event has been played, or forcing the `channel group` to be created before a sound is played on it.

I would suggest loading the `channel group` into memory which will allow you to add the DSP. To do so you will want to call `Bus.lockChannelGroup()` ([FMOD API | Studio API Reference - Bus](https://fmod.com/docs/2.02/api/studio-api-bus.html#studio_bus_lockchannelgroup)), while this will begin the process of loading the `channel group` it will not be immediately, so you can use the function `StudioSystem.flushCommands()` ([FMOD API Studio API Reference - System](https://fmod.com/docs/2.02/api/studio-api-system.html#studio_system_flushcommands)) which will ensure the `channel group` is created.

You will have to remember to call `Bus.unlockChannelGroup()` to allow the `channel group` to be cleaned up with the system closing.

Hope this helps!
