summaryrefslogtreecommitdiff
path: root/localv4ldump
diff options
context:
space:
mode:
Diffstat (limited to 'localv4ldump')
-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