Mercurial > hg > mirex2013
view structural_segmentation/segmentino/segmentino.sh @ 11:14844597d4d7
Add key detector task; use explicit directory for ttl files
author | Chris Cannam |
---|---|
date | Mon, 02 Sep 2013 15:45:15 +0100 |
parents | e5970597e220 |
children |
line wrap: on
line source
# runs sonic annotator using the specified transform file (-t) # input file: $1 # output file: $2 mydir=`dirname "$0"` infile="$1" outfile="$2" if [ t"$infile" = "t" ] || [ t"$outfile" = "t" ]; then echo "Usage: $0 infile.wav outfile.txt" exit 2 fi echo "Processing input WAV file $infile, writing results to $outfile..." 1>&2 # Convert the Sonic Annotator format # # filename;starttime;duration;value;"label" # # to the lab format # # starttime<TAB>endtime<TAB>label # # To ensure both start and end times have the same number of # significant digits, we'll do an addition in awk for both (hence # the $2+0 for start time) VAMP_PATH="$mydir" sonic-annotator \ -t "$mydir"/segmentino.ttl \ -w csv --csv-stdout --csv-separator ";" \ "$infile" \ | awk -F';' '{ gsub(/\"/, ""); print $2+0"\t"$2+$3"\t"$5 }' \ > "$outfile"