All pastes #544770 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-06 16:10 UTC
rendered paste body

#!/bin/bash

VERSION="1.0"

[ -z $1 ] && {
        echo
        echo "ExPoN's calc seconds v$VERSION"
        echo "Usage: mksec MP3.mp3..."
        echo
        exit 0
}

echo "Calculating seconds..."
seconds=$(sox "$1" -e stat 2>&1 | grep 'Length' | \
sed -e "s/[^0-9]*\([0-9][0-9]*\)\..*/\1/g")

echo "$1 is $seconds sec"

exit 0