# Loop 2 audio clips of different length independantly

**URL:** <https://qa.fmod.com/t/loop-2-audio-clips-of-different-length-independantly/22236>\
**Category:** FMOD Studio\
**Created:** [October 29, 2024, 4:35pm UTC](https://qa.fmod.com/t/loop-2-audio-clips-of-different-length-independantly/22236 "2024-10-29T16:35:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gksounds](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@gksounds](https://qa.fmod.com/u/gksounds)\
**Post date:** [October 29, 2024, 4:35pm UTC](https://qa.fmod.com/t/loop-2-audio-clips-of-different-length-independantly/22236/1 "2024-10-29T16:35:47Z")

</div>

Hi there,

I have 2 audio tracks - each have clips of different lengths. How do I loop them independently of each other while playing simultaneously?

One is level atmosphere / environment and the other is a heartbeat that I need to loop alongside it.

Any ideas? Shiuld I be using a multi instrument instead?

Thanks in advance

---

<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:** [October 30, 2024, 3:06am UTC](https://qa.fmod.com/t/loop-2-audio-clips-of-different-length-independantly/22236/2 "2024-10-30T03:06:27Z")

</div>

There’s a few different ways to do this. Assuming you just need both instruments to loop without variation, the simplest option is to place both instruments on a timeline sheet or parameter sheet (if they’re not on one already), set them to asynchronous mode and loop instrument mode (by selecting each instrument and clicking its “Async” and “Loop Instrument” buttons). If they’re on a timeline sheet and not some other parameter sheet, position a loop region or sustain point over them such that the timeline playback position never moves off their trigger regions.

---

<div class="post-metadata">

**Author:** ![gksounds](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@gksounds](https://qa.fmod.com/u/gksounds)\
**Post date:** [October 30, 2024, 10:53am UTC](https://qa.fmod.com/t/loop-2-audio-clips-of-different-length-independantly/22236/3 "2024-10-30T10:53:07Z")

</div>

Thank you Joseph, this worked perfectly.

Can I also ask (and this may be a stupid question), for this event, I have basically some atmos / enviro looping. It’s simple looped atmos for a menu screen that launches and then stops upon return to normal gameplay.

I have an AHDSR for volume release setup for when I hit stop - everything is looping nice and everything is ready to rock.

My question is this - when FMOD exposes this event in Unity, will it automatically adhere to the ‘stop play’ commands. In other words, does Unity have a build in ‘event end’ command that tells the event to stop playing (when player clicks off of this menu) and will this then trigger FMOD’s AHDSR volume release for a smooth fadeout?

Basically, I don’t need to add any other kind of ‘stop playing’ or ‘event has ended’ command element to my FMOD event? Unity will just handle this triggering of stopping the event?

---

<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:** [November 7, 2024, 5:43am UTC](https://qa.fmod.com/t/loop-2-audio-clips-of-different-length-independantly/22236/4 "2024-11-07T05:43:50Z")

</div>

> [@gksounds](#):
>
> when FMOD exposes this event in Unity, will it automatically adhere to the ‘stop play’ commands. In other words, does Unity have a build in ‘event end’ command that tells the event to stop playing (when player clicks off of this menu) and will this then trigger FMOD’s AHDSR volume release for a smooth fadeout?

The Studio API has two different [stop modes](https://www.fmod.com/docs/2.03/api/studio-api-eventinstance.html#fmod_studio_stop_mode) that may be used when stopping an event instance: `FMOD_STUDIO_STOP_ALLOWFADEOUT` and `FMOD_STUDIO_STOP_IMMEDIATE`. As the names suggest, `FMOD_STUDIO_STOP_ALLOWFADEOUT` makes the event instance begin its stopping behaviour, including any AHDSR modulator release periods on the event’s properties, whereas `FMOD_STUDIO_STOP_IMMEDIATE` stops the event immediately without waiting for its stopping behavior.

Both of these stop modes are available in the Unity integration. A [Studio event emitter’s](https://www.fmod.com/docs/2.03/unity/game-components.html#studio-event-emitter) advanced options includes an [allow fadeout checkbox](https://www.fmod.com/docs/2.03/unity/game-components.html#allow-fadeout) that does what you would expect, an [FMOD event playable](https://www.fmod.com/docs/2.03/unity/timeline.html#fmod-event-playable) has a [stop mode property](https://www.fmod.com/docs/2.03/unity/timeline.html#stop-mode), and these properties can also be [set via script](https://www.fmod.com/docs/2.03/unity/api-studioeventemitter.html#studioeventemitter_allowfadeout).
