mIRC Home    About    Download    Register    News    Help

Print Thread
$sound(file.mp3).length not reporting right #259851 05/02/17 07:49 PM
Joined: Aug 2015
Posts: 34
_
_entropy Offline OP
Ameglian cow
OP Offline
Ameglian cow
_
Joined: Aug 2015
Posts: 34
$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 Website: https://mircscripts.net - Register today!
Re: $sound(file.mp3).length not reporting right [Re: _entropy] #259857 05/02/17 11:39 PM
Joined: Dec 2002
Posts: 4,488
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,488
$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.

Re: $sound(file.mp3).length not reporting right [Re: _entropy] #259913 10/02/17 02:11 PM
Joined: Aug 2016
Posts: 36
ruprecht Offline
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.