View Single Post
  #1  
Old 12-23-2012, 01:52 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
musicpos and musiclen

Hey, just trying to calculate the position of a song in seconds.
I'm assuming musiclen and musicpos are in bytes? not bits?
So it's either /1024 or /1000 not sure.
Anyway, iv'e tried a few things.
This seemed the most logical but failed.
PHP Code:
  temp.mp musicpos//Current position, assuming it's the current byte you're at.
  
temp.ml musiclen//Total bytes.
  
temp.bitrate 128//The bit rate of the song, needed to get seconds.
  
temp.mps musicpos/1024/bitrate/60//Should be the second you're at. 
Any advice?
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote