summaryrefslogtreecommitdiff
path: root/dot/local
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2017-12-11 11:28:45 -0500
committerAndrew Cady <d@jerkface.net>2017-12-11 11:28:45 -0500
commit3fee359f05c4fa0d4e3e5af81bba1485a212ceec (patch)
treecb5346d5fca8d144093fcf956b75d415a53f0b0a /dot/local
parent435f96cf05fac2dd4cd233039c998a5464bedaca (diff)
new command "record" for quick audio recording
Diffstat (limited to 'dot/local')
-rwxr-xr-xdot/local/bin/record18
1 files changed, 18 insertions, 0 deletions
diff --git a/dot/local/bin/record b/dot/local/bin/record
new file mode 100755
index 0000000..646ecee
--- /dev/null
+++ b/dot/local/bin/record
@@ -0,0 +1,18 @@
1#!/bin/sh
2output=mic-recording.$(date -Iseconds).mp3
3latest=mic-recording.latest.mp3
4ffmpeg -loglevel error -f alsa -ac 2 -i default -acodec libmp3lame -ab 192k ./"$output" &
5pid=$!
6
7if [ "$DISPLAY" ]; then
8 xmessage 'click OK to stop recording'
9else
10 echo 'press ENTER to stop recording'
11 read line
12fi
13
14kill $pid
15
16if [ -L "$latest" -o ! -e "$latest" ]; then
17 ln -sf "$output" "$latest"
18fi