mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2015
Posts: 70
Babel fish
OP Offline
Babel fish
Joined: Aug 2015
Posts: 70
$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)

Last edited by _entropy; 05/02/17 08:55 PM.

mIRC Scripts IRC Network: irc://irc.mircscripts.info/chat
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
$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.

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
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.


Link Copied to Clipboard