A simple code to give you the mp3 length/position information of the currently playing mp3. See the in-code comments for more details about this snippet and how to use.
;;; mp3 length/pos statistics - Saeed * 2007 ;;;
/*
About: Returns the length or the position of a current mp3 in a basic time format. A pretty useful snippet for those who are building mp3 players.
Usage: $inlength or $inpos or a combination of the two: $inposlen
*/
alias inlength {
if ($inmp3) {
var %variable $calc($insong.length / 1000)
return $gmt(%variable,nn:ss)
}
}
alias inpos {
is ($inmp3) {
var %variable $calc($insong.pos / 1000)
return $gmt(%variable,nn:ss)
}
}
alias inposlen {
if ($inmp3) {
var %a = $calc($insong.pos / 1000), %b = $calc($insong.length / 1000)
return $+($gmt(%a,nn:ss),$chr(47),$gmt(%b,nn:ss))
}
}
var %variable $calc($insong.length / 1000)[/code[
shouldnt it be
var %variable = $calc($insong.length / 1000)
and is the halt necessary? cant u do
alias inlength {
if ($inmp3) {
var %variable $calc($insong.length / 1000)
return $gmt(%variable,nn:ss)
}
}
i may be wrong, so feel free to correct me
otherwise, i havent tested it, but it looks like it would work great, good job