Chris@64: # runs sonic annotator using the specified transform file (-t) Chris@64: # input file: $1 Chris@64: # output file: $2 Chris@64: Chris@64: mydir=`dirname "$0"` Chris@64: infile="$1" Chris@64: outfile="$2" Chris@64: Chris@64: if [ t"$infile" = "t" ] || [ t"$outfile" = "t" ]; then Chris@64: echo "Usage: $0 infile.wav outfile.txt" Chris@64: exit 2 Chris@64: fi Chris@64: Chris@64: echo "Processing input WAV file $infile, writing results to $outfile..." 1>&2 Chris@64: Chris@64: # Convert the Sonic Annotator format Chris@64: # Chris@64: # filename;starttime;duration;value;"label" Chris@64: # Chris@64: # to the lab format Chris@64: # Chris@64: # starttimeendtimelabel Chris@64: # Chris@64: # To ensure both start and end times have the same number of Chris@64: # significant digits, we'll do an addition in awk for both (hence Chris@64: # the $2+0 for start time) Chris@64: Chris@64: VAMP_PATH="$mydir" sonic-annotator \ Chris@64: -t "$mydir"/segmentino.ttl \ Chris@64: -w csv --csv-stdout --csv-separator ";" \ Chris@64: "$infile" \ Chris@64: | awk -F';' '{ gsub(/\"/, ""); print $2+0"\t"$2+$3"\t"$5 }' \ Chris@64: > "$outfile" Chris@64: