Trying to find the Sound.TimeLength through SoundId

Greetings everyone,

Here is the situation, I’m trying to display a length of sound by typing the soundId into a TextBox. How ever I’m looking for a way to do it by extracting it from the Asset Data, Library API, etc.
I tried setting the soundId of a sound object and reading the TimeLength from it however it sometimes gives a “Failed to load sound” error.
I looked up for the entire response JSON format of the sound that is acquired by the library API however there were no such thing as TimeLength

Thank you all for your help.
Stay safe.

1 Like

I think the best and only way to get the TimeLength is loading the id in a sound obj. And you can check if the sound is loaded(sound.IsLoaded) so if the loading fail, you can retry the loading.

sound.IsLoaded seems to be a good idea that I’ve missed. However, it still causes delays if I use a wait() loop until the sound.IsLoaded is true. I wish there were a system for TimeLength too.