# Weird looping issue in Fmod + UE4

**URL:** https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182
**Category:** Unreal Engine
**Created:** [November 4, 2019, 3:07pm UTC](https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182 "2019-11-04T15:07:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Yuwee](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@Yuwee](https://qa.fmod.com/u/Yuwee)
#### Post date: [November 4, 2019, 3:07pm UTC](https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182/1 "2019-11-04T15:07:10Z")

</div>

Hi there !

Working with Fmod and UE 4.22 and I have a weird looping issue.

Basically what happens is the first time my sound loops, it clicks, but only while playing in the engine, not in fmod and not in my DAW, and only on the first loop, after that initial click everything is working just fine.

I tried to add small fades in my asset, and pretty much every stupid idea that crossed my mind but nothing changed ^^

Edit : I would like to specify that this loop is triggered through an event instrument nested in another event via a sustain point.

---

<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 5, 2019, 10:29pm UTC](https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182/2 "2019-11-05T22:29:17Z")

</div>

Are any of the instruments synchronous? How and when is your banks’ sample data being loaded?

How are you triggering an instrument with a sustain point?

---

<div class="post-metadata">

### Author: ![Yuwee](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@Yuwee](https://qa.fmod.com/u/Yuwee)
#### Post date: [November 7, 2019, 11:46am UTC](https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182/3 "2019-11-07T11:46:15Z")

</div>

All the instuments are synchronous, and when I set them to Asynchronous they start clicking even in fmod and don’t loop properly.

My banks are separated so I have a master bank and several other banks. The event is in an ambiance bank.

The event’s setup is as follows :

 ![Turbineevent](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/c706fdeae27f83b56b4872b532577c81f76f930d.png)

---

<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 8, 2019, 4:31am UTC](https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182/4 "2019-11-08T04:31:36Z")

</div>

If you wait for a short while after selecting the event and before clicking the play button in the transport bar, does the click occur?

I ask because FMOD Studio loads the sampledata for an event into memory when you select that event in the events browser - so if you click the play button too quickly, the event might start playing before the sampledata is fully loaded. Nonstreaming synchronous instruments in your event can’t start producing output until their sampledata has finished loading, so such instruments may begin playing their content a little late - and, as a synchronous instrument plays the part of its waveform that’s overlapped by the timeline playback position, starting a little late means it’s likely starting with a part of the waveform that isn’t a zero crossing, which might explain the click you’re hearing.

In-game, the FMOD Engine loads audio differently, so this click will not occur.

---

<div class="post-metadata">

### Author: ![Yuwee](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@Yuwee](https://qa.fmod.com/u/Yuwee)
#### Post date: [November 8, 2019, 9:48am UTC](https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182/5 "2019-11-08T09:48:41Z")

</div>

The thing is the click happens only in the engine and only on the first loop.

But I fixed it by reducing the size of the loop. I was 16sec long and I reduced it to 8sec. I guess the full setup + the long asset to load was a bit much

---

<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 11, 2019, 12:46am UTC](https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182/6 "2019-11-11T00:46:55Z")

</div>

It’s good to hear that you’ve resolved the issue.

If you’re ever looking for an alternative way of dealing with the issue, you may want to change how and when your game loads banks. For information on that topic, see the [Loading Banks Within Unreal](https://www.fmod.com/resources/documentation-ue4?version=2.0&page=user-guide.html#loading-banks-within-unreal) section of the [User Guide](https://www.fmod.com/resources/documentation-ue4?version=2.0&page=user-guide.html) chapter of our [UE4 Integration manual](https://www.fmod.com/resources/documentation-ue4?version=2.0&page=welcome.html).

---

<div class="post-metadata">

### Author: ![Yuwee](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@Yuwee](https://qa.fmod.com/u/Yuwee)
#### Post date: [November 12, 2019, 8:21am UTC](https://qa.fmod.com/t/weird-looping-issue-in-fmod-ue4/15182/7 "2019-11-12T08:21:45Z")

</div>

Thanks Joseph, I’ll check it out because in the end… It’s not fixed aha I thought I managed to fix it but no 😅
