# C# How to Play Sound When Event Fired

**URL:** <https://qa.fmod.com/t/c-how-to-play-sound-when-event-fired/14014>\
**Category:** FMOD Engine\
**Created:** [July 23, 2018, 11:10pm UTC](https://qa.fmod.com/t/c-how-to-play-sound-when-event-fired/14014 "2018-07-23T23:10:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sneaky\_Tactician](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sneaky\_Tactician](https://qa.fmod.com/u/Sneaky_Tactician)\
**Post date:** [July 23, 2018, 11:10pm UTC](https://qa.fmod.com/t/c-how-to-play-sound-when-event-fired/14014/1 "2018-07-23T23:10:06Z")

</div>

The below C# code should play a sound when it runs, but it doesn’t. Sound banks load fine, and I see the event list. Nothing happens when I start an event though. Help?

```
   public static void Test()
    {
        FMOD.RESULT result7 = FMOD.Studio.System.create(out FMOD.Studio.System a);
        a.getLowLevelSystem(out FMOD.System low);
        FMOD.RESULT result11 = low.setSoftwareFormat(0, FMOD.SPEAKERMODE._7POINT1, 0);
        FMOD.RESULT result6 = a.initialize(1, INITFLAGS.NORMAL, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
        FMOD.RESULT result = a.loadBankFile(FileSystemManager.RootDirectory + "/Content/Banks/Master_Bank.bank", FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out Bank testBank);
        FMOD.RESULT result10 = a.loadBankFile(FileSystemManager.RootDirectory + "/Content/Banks/Master_Bank.strings.bank", LOAD_BANK_FLAGS.NORMAL, out Bank bank);

        FMOD.RESULT result9 = testBank.loadSampleData();
        FMOD.RESULT result5 = testBank.getEventList(out EventDescription[] someArray);
        //FMOD.RESULT result12 = someArray[0].setCallback(testmethod, EVENT_CALLBACK_TYPE.STARTED);
        //FMOD.RESULT result8 = someArray[0].loadSampleData();
        FMOD.RESULT result4 = someArray[0].createInstance(out EventInstance instance);
        FMOD.RESULT result3 = instance.setVolume(1F);
        FMOD.RESULT result2 = instance.start();
        //FMOD.Studio.EVENT_CALLBACK
    }
```

---

<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:** [July 27, 2018, 4:29am UTC](https://qa.fmod.com/t/c-how-to-play-sound-when-event-fired/14014/2 "2018-07-27T04:29:10Z")

</div>

> [@](#):
>
> The below C# code should play a sound when it runs, but it doesn’t. Sound banks load fine, and I see the event list. Nothing happens when I start an event though. Help?
> 
> ```
> public static void Test()
> {
> FMOD.RESULT result7 = FMOD.Studio.System.create(out FMOD.Studio.System a);
> a.getLowLevelSystem(out FMOD.System low);
> FMOD.RESULT result11 = low.setSoftwareFormat(0, FMOD.SPEAKERMODE._7POINT1, 0);
> FMOD.RESULT result6 = a.initialize(1, INITFLAGS.NORMAL, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
> FMOD.RESULT result = a.loadBankFile(FileSystemManager.RootDirectory + "/Content/Banks/Master_Bank.bank", FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out Bank testBank);
> FMOD.RESULT result10 = a.loadBankFile(FileSystemManager.RootDirectory + "/Content/Banks/Master_Bank.strings.bank", LOAD_BANK_FLAGS.NORMAL, out Bank bank);
> 
> FMOD.RESULT result9 = testBank.loadSampleData();
> FMOD.RESULT result5 = testBank.getEventList(out EventDescription[] someArray);
> //FMOD.RESULT result12 = someArray[0].setCallback(testmethod, EVENT_CALLBACK_TYPE.STARTED);
> //FMOD.RESULT result8 = someArray[0].loadSampleData();
> FMOD.RESULT result4 = someArray[0].createInstance(out EventInstance instance);
> FMOD.RESULT result3 = instance.setVolume(1F);
> FMOD.RESULT result2 = instance.start();
> //FMOD.Studio.EVENT_CALLBACK
> }
> 
> ```

The first thing would be to check all your results.  
Are all of your results == FMOD.OK?

---

<div class="post-metadata">

**Author:** ![Scott102](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@Scott102](https://qa.fmod.com/u/Scott102)\
**Post date:** [July 18, 2019, 5:48am UTC](https://qa.fmod.com/t/c-how-to-play-sound-when-event-fired/14014/3 "2019-07-18T05:48:10Z")

</div>

I had this issue as well and it came down to not setting system.update() after instance.start()

FMOD.RESULT result2 = instance.start();  
a.update();
