Jump to content

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


 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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 %.

Link to comment
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)
Link to comment
Share on other sites

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...