diff options
author | Andrew Cady <d@jerkface.net> | 2017-12-11 11:28:45 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2017-12-11 11:28:45 -0500 |
commit | 3fee359f05c4fa0d4e3e5af81bba1485a212ceec (patch) | |
tree | cb5346d5fca8d144093fcf956b75d415a53f0b0a /dot/local | |
parent | 435f96cf05fac2dd4cd233039c998a5464bedaca (diff) |
new command "record" for quick audio recording
Diffstat (limited to 'dot/local')
-rwxr-xr-x | dot/local/bin/record | 18 |
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 | ||
2 | output=mic-recording.$(date -Iseconds).mp3 | ||
3 | latest=mic-recording.latest.mp3 | ||
4 | ffmpeg -loglevel error -f alsa -ac 2 -i default -acodec libmp3lame -ab 192k ./"$output" & | ||
5 | pid=$! | ||
6 | |||
7 | if [ "$DISPLAY" ]; then | ||
8 | xmessage 'click OK to stop recording' | ||
9 | else | ||
10 | echo 'press ENTER to stop recording' | ||
11 | read line | ||
12 | fi | ||
13 | |||
14 | kill $pid | ||
15 | |||
16 | if [ -L "$latest" -o ! -e "$latest" ]; then | ||
17 | ln -sf "$output" "$latest" | ||
18 | fi | ||