mp3 Player
alias mp3 {
var %mp3_file = $dir="Select a file to play" D:\
if (%mp3_file) {
var %bitrate = $mp3(%mp3_file).bitrate kbps , %sample = $calc( $mp3(%mp3_file).sample / 1000 ) khz , %secs
var %length = $remove( $duration( $calc( $mp3(%mp3_file).length / 1000 ) ) , secs , sec )
var %min = $gettok( $replace( %length , mins , $chr(58) , min , $chr(58) ) , 1 , 32 )
var %newsec = 0 $+ $gettok(%length,$numtok(%length,32),32)
if ( $numtok(%length,32) == 1 ) { set -n %secs 00 }
if ( $len( $gettok(%length,$numtok(%length,32),32) ) == 1 ) { %secs = %newsec }
if ( $len( $gettok(%length,$numtok(%length,32),32) ) == 2 ) { %secs = $gettok(%length,$numtok(%length,32),32) }
%length = %min $+ %secs
ame is playing ( $+ $lower($nopath(%mp3_file)) $+ ) ( $+ $iif($mp3(%mp3_file).length , %length , n/a ) $+ )
splay " $+ %mp3_file $+ "
}
else { return }
}