# Can you set Programmer Instrument Loop Count to Infinite Or Not Destroy Sound?

**URL:** <https://qa.fmod.com/t/can-you-set-programmer-instrument-loop-count-to-infinite-or-not-destroy-sound/20264>\
**Category:** Unity\
**Tags:** unity\
**Created:** [May 30, 2023, 3:23pm UTC](https://qa.fmod.com/t/can-you-set-programmer-instrument-loop-count-to-infinite-or-not-destroy-sound/20264 "2023-05-30T15:23:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wengyhongwork](https://avatars.discourse-cdn.com/v4/letter/w/4491bb/32.png) [@wengyhongwork](https://qa.fmod.com/u/wengyhongwork)\
**Post date:** [May 30, 2023, 3:23pm UTC](https://qa.fmod.com/t/can-you-set-programmer-instrument-loop-count-to-infinite-or-not-destroy-sound/20264/1 "2023-05-30T15:23:20Z")

</div>

Hi there,

I am trying to set programmer instrument to loop infinitely ( basically for it to never destroy itself ).

I was able to set it to max of 1000. Is there any way to make it infinite? Or not to destroy itself?

![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/b0c4307c5e3fd8b51fb53d666cd48cb4178255ee.png)

Thanks

---

<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:** [May 31, 2023, 3:28am UTC](https://qa.fmod.com/t/can-you-set-programmer-instrument-loop-count-to-infinite-or-not-destroy-sound/20264/2 "2023-05-31T03:28:18Z")

</div>

To set a programmer instrument to loop infinitely, set its play count to 0. This automatically sets it to oo, infinity.

i should mention that if you want an infinitely looping instrument to play forever, you must ensure that it remains triggered. If it is ever untriggered, FMOD will assume you want to stop it, and so will cause the instrument to stop once it finishes playing out its current loop.

---

<div class="post-metadata">

**Author:** ![wengyhongwork](https://avatars.discourse-cdn.com/v4/letter/w/4491bb/32.png) [@wengyhongwork](https://qa.fmod.com/u/wengyhongwork)\
**Post date:** [May 31, 2023, 3:51am UTC](https://qa.fmod.com/t/can-you-set-programmer-instrument-loop-count-to-infinite-or-not-destroy-sound/20264/3 "2023-05-31T03:51:03Z")

</div>

Hi there,

I tried setting it to oo before but it only played once. When I set it to 1000, then the looping works.

Currently I am using FMOD Studio 2.02.04

---

<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:** [June 1, 2023, 3:33am UTC](https://qa.fmod.com/t/can-you-set-programmer-instrument-loop-count-to-infinite-or-not-destroy-sound/20264/4 "2023-06-01T03:33:59Z")

</div>

As I mentioned above, for infinite looping to work, you must ensure the instrument remains triggered. That means that for as long as you want the instrument to continue infinitely looping, the playback position must remain over the instrument’s trigger region, and the instrument’s trigger conditions must remain met.

---

<div class="post-metadata">

**Author:** ![lgarczyn](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@lgarczyn](https://qa.fmod.com/u/lgarczyn)\
**Post date:** [June 3, 2023, 12:13pm UTC](https://qa.fmod.com/t/can-you-set-programmer-instrument-loop-count-to-infinite-or-not-destroy-sound/20264/5 "2023-06-03T12:13:51Z")

</div>

Setting the event to persistent might help too, no ?

---

<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:** [June 5, 2023, 7:58am UTC](https://qa.fmod.com/t/can-you-set-programmer-instrument-loop-count-to-infinite-or-not-destroy-sound/20264/6 "2023-06-05T07:58:39Z")

</div>

No, setting the event to be persistent won’t help in this case.
