How do I get the length of a audio file?

Get help using Construct 2

Post » Wed Feb 25, 2015 10:45 am

Hi!

I am working with a lot of sounds in Construct 2 at the moment and one thing i just can't figure out is:

How do i get the length of a sound file? Aka duration.

I've figured out that Audio.Duration is something but i tried some combo's that didn't work ( like Audio.Duration("Sound1"), Sound1.ogg etc.

So my question is fairly easy. Is there a way to get the duration of a sound?

Why? I want to use the duration of a sound to change a objects width.

Any help is appreciated! Thanks in advance!
B
10
S
4
G
3
Posts: 163
Reputation: 2,507

Post » Wed Feb 25, 2015 10:56 am

It needs to be playing for the duration expression to work.
Scirra Founder
B
378
S
220
G
84
Posts: 23,871
Reputation: 188,237

Post » Wed Feb 25, 2015 11:06 am

@Ashley Thanks for your reply.

Will find another solution for my issue. Thanks for the quick answer!
B
10
S
4
G
3
Posts: 163
Reputation: 2,507


Return to How do I....?

Who is online

Users browsing this forum: AllanR and 11 guests