-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathau
executable file
·28 lines (23 loc) · 901 Bytes
/
au
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
#=======================================================================
# au
# File ID: 3c212296-2a91-11e1-a6ba-77ff51cfb7ce
# Edit all kind of files in Audacity
# License: GNU General Public License version 2 or later.
#=======================================================================
progname=au
lockdir=$HOME/.au.LOCK
myexit() {
rmdir $lockdir || echo $progname: $lockdir: Cannot remove lockdir >&2
exit $1
}
trap "myexit 1" INT TERM
mkdir $lockdir || { echo $progname: $lockdir: Cannot create lockdir >&2; exit 1; }
file="$@"
test -e "$file" || { echo $progname: $file: File not found >&2; myexit 1; }
audir=$HOME/tmp/au
mkdir -p $audir
wavfile="$audir/$file.wav"
# FIXME: Need a way to check that the .wav file isn't truncated or edited
test -e "$wavfile" || mplayer -novideo -ao "pcm:file=$wavfile" "$file"
(sess -t c_au audacity "$wavfile"; myexit 0) &