#How do I know duration of an AudioSource?

6 messages · Page 1 of 1 (latest)

glossy mango
#

I want to limit quantity of audio sources by priority, and thus I need to track sounds with their duration.

minor condor
glossy mango
minor condor
#

yeah, sorry ><"

unreal cargo
#

Possible solution:


fn get_duration(source: AudioSource) ->      Option<Duration> {
    source.decoder().total_duration()
}
#

tested on wav audio files, it works.
seems to be inefficient solution for a runtime, better would be to get audio durations on loading assets, then save them somewhere in Resources