Sign in to follow this  
Followers 0
TehWhale

[RESOLVED] Get the % of song complete with _SoundLength and _SoundPos

6 posts in this topic

#1 ·  Posted (edited)

So, as some of you know I'm working on iPod Media Player, but I've hit a barricade. If I have a song playing I need to know the currently completed (listened to I guess) amount of sound as percent, like if I was listening to a 5:00 long sound, and It was at 2:30 it should return 50.

-Snipped- No more sneak peak at my script :P

Look at last post for solution.

Edited by TehWhale

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Edited: I fixed the first issue of text going off screen, and then the time remaining of the song, but now I need to find out how to get the percent complete of the current sound opened.

Edited by TehWhale

Share this post


Link to post
Share on other sites

Are you sure you're using the newest beta of the Sound UDF? If so you should be able to just do _SoundLength() / _SoundPos() * 100 to get the %.

Share this post


Link to post
Share on other sites

Your post just triggered my mind, and that what I was using before worked, I just didn't know it, but your post is wrong, it's the other way around :P

Heres what I used:

$PercentPlayed = Round(_SoundPos($pOpenSound, 2)/_SoundLength($pOpenSound, 2)*100,0)
_ProgressSet($SongProgress, $PercentPlayed)

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Ok I admit I goofed :(. Cut me some slack I haven't had my coffee yet lol. At least it helped so can't wait to see the final version.

It's 90% done :P Getting ready to post.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0