# Oneshot events?

**URL:** https://qa.fmod.com/t/oneshot-events/11119
**Category:** FMOD Studio
**Created:** [August 27, 2013, 10:20pm UTC](https://qa.fmod.com/t/oneshot-events/11119 "2013-08-27T22:20:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![prehensile](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@prehensile](https://qa.fmod.com/u/prehensile)
#### Post date: [August 27, 2013, 10:20pm UTC](https://qa.fmod.com/t/oneshot-events/11119/1 "2013-08-27T22:20:57Z")

</div>

I’m building an app using FMOD Studio, and I’ve created a bunch of small events, containing only one audio file module. I haven’t changed any settings away from the defaults on either the event or the module on any of these small events.

My assumption was that these events would be one-shot, and only play as long as the single audio module.

What seems to happen, though, is that when I instantiate the event and call eventInstance.start() in my code, the audio loops indefinitely until I call eventInstance.stop().

I can see that an EventDescription has an isOneshot accessor in the API, which would imply that I can set an event to oneshot somewhere in Studio, but I can’t find anything in the UI or the docs.

Am I missing something really obvious here?

---

<div class="post-metadata">

### Author: ![prehensile](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@prehensile](https://qa.fmod.com/u/prehensile)
#### Post date: [August 28, 2013, 8:48am UTC](https://qa.fmod.com/t/oneshot-events/11119/2 "2013-08-28T08:48:11Z")

</div>

Update: I did try immediately releasing the instance after starting it, but still the same looping behaviour.

I have solved my problem, but it’s a really hacky hack:

```auto
    eventInstance.start()
    FMOD::ChannelGroup *grp;
    eventInstance.getChannelGroup( &grp );
    FMOD::ChannelGroup *sub;
    grp->getGroup( 0, &sub );
    FMOD::Channel *chnl;
    sub->getChannel(0, &chnl);
    chnl->setMode(FMOD_LOOP_OFF);
```

There must be a better way than this? Surely there’s a setting in the Studio UI on a sound module? I can see a little loop button on the Sound item in the Deck when the module’s selected, but whether it’s toggled on or off doesn’t seem to make any difference.

---

<div class="post-metadata">

### Author: ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://qa.fmod.com/u/Guest)
#### Post date: [August 28, 2013, 9:53am UTC](https://qa.fmod.com/t/oneshot-events/11119/3 "2013-08-28T09:53:21Z")

</div>

It sounds like you may not be calling System::update(). The Studio API is built on the assumption that your game will call System::update() regularly (usually once per frame). If you are not doing this, you will run into playback issues like the one you describe. If you are calling System::update() regularly, then this is a bug; please let us know and we’ll look into it.

---

<div class="post-metadata">

### Author: ![prehensile](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@prehensile](https://qa.fmod.com/u/prehensile)
#### Post date: [August 28, 2013, 11:30am UTC](https://qa.fmod.com/t/oneshot-events/11119/4 "2013-08-28T11:30:33Z")

</div>

That did the trick, thanks Ben.
