; set file
var %file = $shortfn(somedir\something.mp3)
; set length in seconds ($sound(x).length returns milliseconds)
var %len = $calc($sound(%file).length / 1000)
; use the $duration identifier and the ,3 switch to get an output "hh:mm:ss"
var %dur = $duration(%len,3)
; use $gettok to grab the last 2 tokens "mm:ss", add these square brackets
return $+($chr(91),$gettok(%dur,2-3,58),$chr(93))