From df69a721588dea391e7134907a14be30eee0dad7 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 12 Sep 2013 20:25:13 +0200 Subject: Support Mono recording devices. --- localv4ldump | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3