std sh ga-infounused
[sunny256-utils.git] / au
blob261e3a35b94831cbe4ad39c78c84cdd421ecf8fd
1 #!/usr/bin/env bash
3 #=======================================================================
4 # au
5 # File ID: 3c212296-2a91-11e1-a6ba-77ff51cfb7ce
6 # Edit all kind of files in Audacity
7 # License: GNU General Public License version 2 or later.
8 #=======================================================================
10 progname=au
11 lockdir=$HOME/.au.LOCK
13 myexit() {
14 rmdir $lockdir || echo $progname: $lockdir: Cannot remove lockdir >&2
15 exit $1
18 trap "myexit 1" INT TERM
19 mkdir $lockdir || { echo $progname: $lockdir: Cannot create lockdir >&2; exit 1; }
21 file="$@"
22 test -e "$file" || { echo $progname: $file: File not found >&2; myexit 1; }
23 audir=$HOME/tmp/au
24 mkdir -p $audir
25 wavfile="$audir/$file.wav"
26 # FIXME: Need a way to check that the .wav file isn't truncated or edited
27 test -e "$wavfile" || mplayer -novideo -ao "pcm:file=$wavfile" "$file"
28 (sess -t c_au audacity "$wavfile"; myexit 0) &