# Programmer sound dynamic length

**URL:** https://qa.fmod.com/t/programmer-sound-dynamic-length/13403
**Category:** Unity
**Created:** [September 5, 2017, 1:58pm UTC](https://qa.fmod.com/t/programmer-sound-dynamic-length/13403 "2017-09-05T13:58:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![TrevorVertigo](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@TrevorVertigo](https://qa.fmod.com/u/TrevorVertigo)
#### Post date: [September 5, 2017, 1:58pm UTC](https://qa.fmod.com/t/programmer-sound-dynamic-length/13403/1 "2017-09-05T13:58:50Z")

</div>

Hi all,

We are currently exploring the method of using programmer sounds and audio tables to play localized audio as found in [http://www.fmod.org/documentation/#content/generated/engine\_new\_unity/script\_example\_programmersounds.html](http://www.fmod.org/documentation/#content/generated/engine_new_unity/script_example_programmersounds.html).

What I’m currently struggling with, is that the Sound lengths are different than the programmer sound length. So whenever I play a sound, it either gets cut off too soon, or is playing too long without sound. We want to trigger different gameplay events, or other dialogues, shortly after one dialogue is done playing.

I couldn’t find any way to set the length of a parameter or event in code. What is the suggested approach?

Thanks in advance

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [September 7, 2017, 12:04am UTC](https://qa.fmod.com/t/programmer-sound-dynamic-length/13403/2 "2017-09-07T00:04:44Z")

</div>

In Studio, you can set the programmer sound instrument to be async, this will play out any sound entirely before stopping/destroying. At which time the stopped and destroy callbacks will execute.  
FMOD\_STUDIO\_EVENT\_CALLBACK\_STOPPED,  
FMOD\_STUDIO\_EVENT\_CALLBACK\_SOUND\_STOPPED,  
FMOD\_STUDIO\_EVENT\_CALLBACK\_DESTROY\_PROGRAMMER\_SOUND

For example: the sound you want to play is one minute long and the programmer sound in the event is five seconds long on the timeline, normally the sound would stop after five seconds but using async the sound will continue for one minute, and then execute the stopped callback

---

<div class="post-metadata">

### Author: ![TrevorVertigo](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@TrevorVertigo](https://qa.fmod.com/u/TrevorVertigo)
#### Post date: [September 12, 2017, 7:50am UTC](https://qa.fmod.com/t/programmer-sound-dynamic-length/13403/3 "2017-09-12T07:50:42Z")

</div>

Thanks Cameron, we will try this!
