diff record-audio @ 0:e85e3470a41e

Initial commit of useful scripts
author IBBoard <dev@ibboard.co.uk>
date Sat, 02 Aug 2014 19:31:02 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/record-audio	Sat Aug 02 19:31:02 2014 +0100
@@ -0,0 +1,12 @@
+#! /bin/bash
+
+WAV="$1"
+if [ -z "$WAV" ]; then
+    echo "Usage: $0 OUTPUT.WAV" >&2
+    exit 1
+fi
+rm -f "$WAV"
+
+MONITOR=$(pactl list | grep -A2 '^Source #' | \
+    grep 'Name: .*\.monitor$' | awk '{print $NF}' | tail -n1)
+parec -d "$MONITOR" | sox -t raw -r 44100 -Lb 16 -e signed-integer -c 2 - "$WAV"