summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2013-09-12 20:25:13 +0200
committerJonas Smedegaard <dr@jones.dk>2013-09-12 20:25:13 +0200
commitdf69a721588dea391e7134907a14be30eee0dad7 (patch)
tree0dd2a9ee812a79a95816a37a5847766e2de202c8
parent6674dde7ed462679727d7842e8c3a16835e85186 (diff)
Support Mono recording devices.
-rwxr-xr-xlocalv4ldump11
1 files changed, 10 insertions, 1 deletions
diff --git a/localv4ldump b/localv4ldump
index 99efa17..7a00058 100755
--- a/localv4ldump
+++ b/localv4ldump
@@ -80,7 +80,16 @@ i=0
ainargs=
amaps=
for input in $ainputs; do
- ainargs="${ainargs:+$ainargs }-f alsa -ar 44100 -i hw:$input"
+ # TODO: handle varying descriptions (not just pick first entry)
+ # TODO: handle more descriptions (not just assume stereo)
+ achannels=
+ achannelsdesc="$(amixer -c $input | grep '^ Capture channels:' | head -n 1)"
+ case $achannelsdesc in
+ *: Mono)
+ achannels=1
+ ;;
+ esac
+ ainargs="${ainargs:+$ainargs }-f alsa -ar 44100 ${achannels:+-ac $achannels} -i hw:$input"
amaps="${amaps:+$amaps }-map $i:a"
((i=i+1))
done