# Any way to save on resources by "unloading" tracks in an event?

**URL:** <https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906>\
**Category:** FMOD Studio\
**Created:** [February 23, 2023, 8:45am UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906 "2023-02-23T08:45:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![torley-gallium](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/torley-gallium/32/3688_2.png) [@torley-gallium](https://qa.fmod.com/u/torley-gallium)\
**Post date:** [February 23, 2023, 8:45am UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906/1 "2023-02-23T08:45:33Z")

</div>

Say I have an event that’s environmental ambience (wind, thunder, birdsong) with 16 layered tracks. I have parameters setup to raise gain on some tracks as-needed, so they’re essentially fading in from silence.

Part of the purpose of this is allowing flexibility in a “unified” event while having a big-picture view (so I don’t have to jump between editing different events). Say I play an instance of this event that doesn’t need birdsong, so those tracks are silenced.

When those tracks are silent, is there any way to “unload” them so they’re not using memory or counting as active voices? Even if there’s some clever workaround to do this, I’m curious.

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [February 24, 2023, 3:49am UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906/2 "2023-02-24T03:49:19Z")

</div>

Yes and no. There’s no way to manually unload one specific track of an event at runtime, but FMOD already does most of what you’re asking for automatically.

When the volume of a channel (i.e.: a playing instance of an instrument) drops below a certain threshold (defined by the `vol0virtualvol` value set in `FMOD_ADVANCEDSETTINGS` by your game’s code), that channel is [virtualized](https://fmod.com/docs/2.02/api/white-papers-virtual-voices.html). Virtualized channels are not included in any submixes, and so require much less CPU when compared to active channels, and do not consume voices.

Virtualized channels do, however, still consume memory. This is because they need to keep the asset associated with the instrument loaded into memory (unless it’s a stream, of course), so that in the event that the channel’s volume increases again, it can resume playing the asset as if it had been playing silently the whole time.

---

<div class="post-metadata">

**Author:** ![torley-gallium](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/torley-gallium/32/3688_2.png) [@torley-gallium](https://qa.fmod.com/u/torley-gallium)\
**Post date:** [February 24, 2023, 6:00am UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906/3 "2023-02-24T06:00:54Z")

</div>

@joseph Always great to get your help! Also to clarify, if a `vol0virtualvol` is not specified, what is the default? E.g., if I add a Gain effect to a track and set that to ∞ , will that track of an event be virtualized without needing to set `FMOD_ADVANCEDSETTINGS` ? Is there a best practice for setting this if using Unity-FMOD integration?

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [February 27, 2023, 5:11am UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906/4 "2023-02-27T05:11:13Z")

</div>

> [@torley-gallium](#):
>
> Also to clarify, if a `vol0virtualvol` is not specified, what is the default?

If `vol0virtualvol` is not specified, it defaults to 0. The API uses a scale of 0-1 for volume, so a volume of zero in code corresponds to a volume of -oo dB in FMOD Studio.

Zero’s a good value for it to be at, since it means channels must be completely inaudible to be virtualized by this setting.

Incidentally, you can find the default values of various FMOD settings [in our documentation](https://fmod.com/docs/2.02/api/core-api-system.html#fmod_advancedsettings).

> [@torley-gallium](#):
>
> Is there a best practice for setting this if using Unity-FMOD integration?

It’s enabled by default, so you shouldn’t have to do anything special to get the behavior that’s best for most game projects.

---

<div class="post-metadata">

**Author:** ![torley-gallium](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/torley-gallium/32/3688_2.png) [@torley-gallium](https://qa.fmod.com/u/torley-gallium)\
**Post date:** [February 27, 2023, 6:23pm UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906/5 "2023-02-27T18:23:07Z")

</div>

@joseph I appreciate the clarity! Makes sense. Thanks again… as always.

---

<div class="post-metadata">

**Author:** ![torley-gallium](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/torley-gallium/32/3688_2.png) [@torley-gallium](https://qa.fmod.com/u/torley-gallium)\
**Post date:** [April 12, 2023, 8:52pm UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906/6 "2023-04-12T20:52:22Z")

</div>

@joseph Another fine clarification for this: does channel = track here?

For example:

- Say I have an FMOD event with 12 audio tracks “playing”. All of them also have effects chains.
- 11 of those tracks are currently silent at -∞ gain.
- Therefore, can I expect that all 12 tracks will consume memory, but only the 1 that’s actually heard will be using CPU on the audio playback and effects?

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [April 13, 2023, 4:03am UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906/7 "2023-04-13T04:03:46Z")

</div>

> [@torley-gallium](#):
>
> does channel = track here?

No. As I mentioned above, a channel is generally a playing instance of an instrument.

For example, if an event instance contains an asynchronous single instrument, each time that instrument is triggered is one channel. Thus, if a loop region causes the instrument to be triggered three times, it’ll use three different channels; if the second and third times the instrument is triggered happen before the first time has finished playing out, then all three channels will exist at once; and if there are two instances of the event, and each of them is playing three instances of that instrument, then they’ll use a total of six channels.

> [@torley-gallium](#):
>
> - Say I have an FMOD event with 12 audio tracks “playing”. All of them also have effects chains.
> - 11 of those tracks are currently silent at -∞ gain.
> - Therefore, can I expect that all 12 tracks will consume memory, but only the 1 that’s actually heard will be using CPU on the audio playback and effects?

You are correct that only the effects on the one track with active channels will consume CPU. If all the channels routed into a track are virtualized, the effects on that track are automatically set to idle mode, in which they do not consume any CPU.

---

<div class="post-metadata">

**Author:** ![torley-gallium](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/torley-gallium/32/3688_2.png) [@torley-gallium](https://qa.fmod.com/u/torley-gallium)\
**Post date:** [April 13, 2023, 9:21am UTC](https://qa.fmod.com/t/any-way-to-save-on-resources-by-unloading-tracks-in-an-event/19906/8 "2023-04-13T09:21:10Z")

</div>

I missed that distinction the first time, and your example helped me visualize it. Thanks again!
