# Random Loud Glitch when triggering a specific event

**URL:** https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425
**Category:** Unity
**Created:** [April 1, 2016, 3:17pm UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425 "2016-04-01T15:17:57Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![paulojgames](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@paulojgames](https://qa.fmod.com/u/paulojgames)
#### Post date: [April 1, 2016, 3:17pm UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425/1 "2016-04-01T15:17:57Z")

</div>

Hi,

We are experiencing a very loud random glitch when a specific 3D event plays in Unity. This seems to occur rarely (around 1 out of 50 times). When this bug occurs, this event (a short creature grunt sound) will trigger a 3/4 seconds noise with a RMS level of around 0dBFS (very loud).

The event has the following specifications:

- It’s being called directly by the PlayOneShot() method (it is NOT assigned to an FmodStudioEventEmitter)
- 3D Panner with the default options, except for “Max instances” (they are set to 2) and Min&Max Distance (set to 10.0-40.0)
- a first audio track that plays a multi-sound module.
- 1 parameter that will trigger different multi-sound modules on a second audio track, depending on its value.

We are using Fmod Studio v.1.06.02 and Unity v5.3.3f1

Any ideas why this is happening?

Thanks,  
Renato

---

<div class="post-metadata">

### Author: ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)
#### Post date: [April 4, 2016, 12:55am UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425/2 "2016-04-04T00:55:18Z")

</div>

Check the Speaker Mode set at runtime matches the speaker mode defined in the tool.

For the tool look at the project preferences menu.

For the 1.06.02 Unity Integration you’ll have to modify FMOD\_StudioSystem.cs and add code at line 285

```
var mySpeakerMode = FMOD.SPEAKERMODE.STEREO; // or 5POINT1 or 7POINT1
sys.setSoftwareFormat(mySpeakerMode);
```

---

<div class="post-metadata">

### Author: ![paulojgames](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@paulojgames](https://qa.fmod.com/u/paulojgames)
#### Post date: [April 5, 2016, 10:11am UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425/3 "2016-04-05T10:11:01Z")

</div>

Thanks. In my FMOD Project, in the preferences menu, in the “Format” Tab I have it set to “5.1 Surround”. At runtime the speaker mode is stereo.

I’m trying to add that code in FMOD\_StudioSystem.cs, however, it gives me an error when compiling. Can you specify exactly where this line needs to be added? From line 280 I have the following:

```
// Dummy flush and update to get network state
ERRCHECK(system.flushCommands());
result = system.update();

// Restart without liveupdate if there was a socket error
if (result == FMOD.RESULT.ERR_NET_SOCKET_ERROR)
{
FMOD.Studio.UnityUtil.LogWarning(“LiveUpdate disabled: socket in already in use”);
flags &= ~FMOD.Studio.INITFLAGS.LIVEUPDATE;
ERRCHECK(system.release());
ERRCHECK(FMOD.Studio.System.create(out system));
FMOD.System sys;
ERRCHECK(system.getLowLevelSystem(out sys));
result = system.initialize(1024, flags, FMOD.INITFLAGS.NORMAL, global::System.IntPtr.Zero);
ERRCHECK(result);
}
isInitialized = true;
}
```

---

<div class="post-metadata">

### Author: ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)
#### Post date: [April 6, 2016, 12:58am UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425/4 "2016-04-06T00:58:17Z")

</div>

Add it right after the line

```
ERRCHECK(sys.setAdvancedSettings(ref advancedSettings));
```

---

<div class="post-metadata">

### Author: ![paulojgames](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@paulojgames](https://qa.fmod.com/u/paulojgames)
#### Post date: [April 6, 2016, 5:21pm UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425/5 "2016-04-06T17:21:15Z")

</div>

Thanks. I still get the following compile error though:

> Assets/Plugins/FMOD/FMOD\_StudioSystem.cs(259,29): error CS1501: No  
> overload for method `setSoftwareFormat' takes `1’ arguments

---

<div class="post-metadata">

### Author: ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)
#### Post date: [April 7, 2016, 1:20am UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425/6 "2016-04-07T01:20:39Z")

</div>

> [@](#):
>
> Thanks. I still get the following compile error though:
> 
> > Assets/Plugins/FMOD/FMOD\_StudioSystem.cs(259,29): error CS1501: No  
> > overload for method `setSoftwareFormat' takes `1’ arguments

sorry, my mistake: for you it would be sys.setSoftwareFormat(48000, FMOD.SPEAKERMODE.\_5POINT1, 0);

---

<div class="post-metadata">

### Author: ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)
#### Post date: [April 14, 2016, 1:35am UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425/7 "2016-04-14T01:35:41Z")

</div>

Did this fix your compile errors and sound glitches?

---

<div class="post-metadata">

### Author: ![paulojgames](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@paulojgames](https://qa.fmod.com/u/paulojgames)
#### Post date: [April 14, 2016, 5:16pm UTC](https://qa.fmod.com/t/random-loud-glitch-when-triggering-a-specific-event/12425/8 "2016-04-14T17:16:57Z")

</div>

Sorry Nicholas, I haven’t tried this yet. I’ll give feedback ASAP 🙂
