Results 1 to 4 of 4

Thread: counting down time

  1. #1

    Thread Starter
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125

    Lightbulb

    I am making an mp3 player and I need to know how to count down the time of the song. I already have the length of the song in a label, but it stays the same. How can I make it count down to 0:00 then close the mp3?

    Thanks
    <removed by admin>

  2. #2
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    Total Time - Current Position = Time Remaining

  3. #3

    Thread Starter
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    how can i format the time? i have the time in seconds and i tried format(LengthInSec, "00:00") but when it got to 60 seconds it just kept counting. It didn't go to 1:00, it went to :61 then :62, etc. How can i fix this?
    <removed by admin>

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Well you can get the number of hours using the Mod operator, like this:
    Code:
    HoursLeft = LengthInSecs Mod 60
    and you can get the remainder, the number of seconds left over, using the integer division operator, \, like this:
    Code:
    RemainderSecs = LengthInSecs  \ 60
    Hope that's what you're looking for
    Harry.

    "From one thing, know ten thousand things."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width