# GetLength from Event with Parameter

**URL:** <https://qa.fmod.com/t/getlength-from-event-with-parameter/22878>\
**Category:** FMOD Studio\
**Tags:** unity, csharp\
**Created:** [May 4, 2025, 1:41pm UTC](https://qa.fmod.com/t/getlength-from-event-with-parameter/22878 "2025-05-04T13:41:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeqafStudio](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@DeqafStudio](https://qa.fmod.com/u/DeqafStudio)\
**Post date:** [May 4, 2025, 1:41pm UTC](https://qa.fmod.com/t/getlength-from-event-with-parameter/22878/1 "2025-05-04T13:41:47Z")

</div>

Hello,

I have easy task: GetLength.

```auto
voiceNew = RuntimeManager.CreateInstance ("event:/Voiceovers/voice1");
voiceNew.start ();
voiceNew.setParameterByName ("Language", voiceID);
voiceNew.getDescription(out EventDescription ed);
ed.getLength(out int len);
//len=0 everytime

```

This code works fine for simple event, but event with Parameter return 0.

I have one event with few languages and switch after start.  
Parameter type = labeled.

 ![f1](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/9/9930b98192e64c67352aded08d2f4bf48372489c.jpeg)

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [May 7, 2025, 2:40am UTC](https://qa.fmod.com/t/getlength-from-event-with-parameter/22878/2 "2025-05-07T02:40:20Z")

</div>

Hi,

Thank you for sharing the information and screenshot.

> [@DeqafStudio](#):
>
> This code works fine for simple event, but event with Parameter return 0.

[Studio::EventDescription::getLength](https://www.fmod.com/docs/2.03/api/studio-api-eventdescription.html#studio_eventdescription_getlength) only returns the length of the timeline. If your event doesn’t have any content placed directly on the timeline (e.g., it uses parameter sheets or instruments triggered by parameters), then this function will return 0.

There’s a similar discussion here: [EventDescription length always zero - #2 by Leah\_FMOD](https://qa.fmod.com/t/eventdescription-length-always-zero/20638/2)

If restructuring your event to use the timeline isn’t feasible, you might consider using the `SOUND_PLAYED` callback. This allows you to access the underlying `FMOD::Sound` object and retrieve its length during playback.

You can find more details and sample code in this thread:: [How to retrieve a sound total time/length/duration? - #4 by jeff\_fmod](https://qa.fmod.com/t/how-to-retrieve-a-sound-total-time-length-duration/19300/4)

Hope this helps, let me know if you have questions.
