# Issues with sounds in for loops

**URL:** <https://forums.unrealengine.com/t/issues-with-sounds-in-for-loops/1213945>\
**Category:** Blueprint\
**Tags:** play-sound-at-locati, unreal-engine, bug-report, Blueprint, question\
**Created:** [June 29, 2023, 1:44am UTC](https://forums.unrealengine.com/t/issues-with-sounds-in-for-loops/1213945 "2023-06-29T01:44:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DennisMahan1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DennisMahan1](https://forums.unrealengine.com/u/DennisMahan1)\
**Post date:** [June 29, 2023, 1:44am UTC](https://forums.unrealengine.com/t/issues-with-sounds-in-for-loops/1213945/1 "2023-06-29T01:44:10Z")

</div>

I’m trying to compile a phrase using sound bites so that I can have an audio clip of a number without having to record every possible number. However, something strange is happening with the for loop.

 ![sound part 1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/a/64a0b7f37e0d942aa83ccac7e5344bb563fb0716.png)  
 ![sound part 2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/4/4/044fabe37680bb049985487dfc27340b5f0c07ee.png)  
Above is the code snippet I’m referring to. in the first photo, you can see the 2 arrays im using, “location sounds” and “location clip lengths”. The first holds an array of sound base object references (the sound clips as uassets) and the second holds an array of floats to keep track of how long the clip is. The arrays are compiled in the ATCALEFoundHVT function. Once i get to the for loop, i have checked and the array is compiled correctly. However, once i step to the play sound node in the loop, there is a pause where another sound, seen in the second photo way further along the blueprint, is played. Looking at the inputs to the play sound node at THAT moment, there is either “none” or the last sound in the array. i.e., its skipping forward along the blueprint and playing a different sound and skipping over all my sound plays in the for loop. Does anyone have any idea why this is happening?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 29, 2023, 8:55am UTC](https://forums.unrealengine.com/t/issues-with-sounds-in-for-loops/1213945/2 "2023-06-29T08:55:19Z")

</div>

I haven’t looked at your code in great detail, but I can tell you that delay does not work in a loop.

You’ll need to make the loop ‘manually’, like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/6/3a6b071bb1a6b4c8664c5b0815028331fd1b9383.png)

---

<div class="post-metadata">

**Author:** ![DennisMahan1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DennisMahan1](https://forums.unrealengine.com/u/DennisMahan1)\
**Post date:** [June 29, 2023, 9:01pm UTC](https://forums.unrealengine.com/t/issues-with-sounds-in-for-loops/1213945/3 "2023-06-29T21:01:08Z")

</div>

that appears to have been the issue. thanks

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 29, 2023, 9:02pm UTC](https://forums.unrealengine.com/t/issues-with-sounds-in-for-loops/1213945/4 "2023-07-29T21:02:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
