Page 1 of 1

Get sound time

Posted: 13 Aug 2015, 13:28
by otyugh
Hey there,
is there a portable way in spring to get the time duration of an audio file ? I'm doing some "climax" sound widget, and I get very upset hardcoding the timings :p

Re: Sound and spring

Posted: 13 Aug 2015, 13:58
by gajop
otyugh wrote:Hey there,
is there a portable way in spring to get the time duration of an audio file ? I'm doing some "climax" sound widget, and I get very upset hardcoding the timings :p
Spring.GetSoundStreamTime() could work

Re: Sound and spring

Posted: 13 Aug 2015, 14:26
by otyugh
Sounds neat indeed. Dunno how I did not see it.

Seems that it only repport the time the sound was played and not its duration.

( ) -> number playedTime, number totalTime

I get number playedTime, but how to get the second one ?

Re: Sound and spring

Posted: 13 Aug 2015, 15:19
by hokomoko
local playedTime, totalTime = Spring.GetSoundStreamTime()

Re: Sound and spring

Posted: 13 Aug 2015, 15:29
by otyugh
This is what I was looking for. Thx.