Length of all mp3s in a dir
Platform: mIRC
Published Dec 05, 2007
Updated Dec 05, 2007
Simple snippet to return the total length of all mp3 files in a directory using mIRC's $sound to retrieve the data. You can return the length in a gmt/time format or mIRC's $duration format. $mp3dl([directory])[.g]
; -------------------------
; This snippet returns the total length of all mp3s in a directory.
; made by Rebellious
; Syntax: $mp3dl([directory])[.g] ( e.g $mp3dl($readini(mirc.ini,dirs,mp3s)) )
; The property [g] returns the length in time format (hh:nn:ss/nn:ss)...
; If not, the regular format is mIRC's $duration format.
; Why make this? Made this for an mp3 player I am working on, decided to release it.
; Downsides? Unfortunately, with a vast amount of mp3s in a directory, the snippet can sometimes cause a lag.
; --------------------------
alias mp3dl {
if ( $isid ) && ( $$1- ) {
var %t
if ( $isdir($1-) ) {
.echo -q $findfile($1-,*.mp3,0,inc %t $sound($1-).length)
return $iif($prop == g,$gmt($calc(%t / 1000),$iif($calc(%t / 1000) > 3600,hh:nn:ss,nn:ss)),$duration($calc(%t / 1000)))
}
else return $false
}
}