mIRC Homepage
Posted By: _entropy $sound(file.mp3).length not reporting right - 05/02/17 07:49 PM
$sound(file.mp3).length returns 353860...

-

//echo . $asctime(353860,nn:ss)
Returns: 17:40 (which is wrong)

//echo . $duration(353860)
Returns: 4days 2hrs 17mins 40secs (which is wrong)
$sound().length returns a millisecond value. Also note that $asctime() is not useful in this context since it takes a $ctime value and returns a time value not a length value.
Yes, as the boss says, length in miliseconds... divide by 1000 to get the correct result.
Code:
%msl = $sound(file.mp3).length
%len = $duration($calc(%msl/1000))

Returns 5mins 53secs for your example.
© mIRC Discussion Forums