diff options
-rwxr-xr-x | dot/local/bin/amixer-capture.sh | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/dot/local/bin/amixer-capture.sh b/dot/local/bin/amixer-capture.sh index 0578c72..cc488fd 100755 --- a/dot/local/bin/amixer-capture.sh +++ b/dot/local/bin/amixer-capture.sh | |||
@@ -2,11 +2,31 @@ | |||
2 | 2 | ||
3 | SETME=${1:-100%} | 3 | SETME=${1:-100%} |
4 | 4 | ||
5 | amixer controls|( | 5 | enable_recording() |
6 | IFS=, | 6 | { |
7 | while read a b c _; do | 7 | local DEV="$1" |
8 | case "${c#name=}" in *Capture*|*Boost*) | 8 | amixer -D "$DEV" controls | ( |
9 | amixer cset "$a,$b,$c" "$SETME";; | 9 | IFS=, |
10 | esac | 10 | while read a b c _; do |
11 | done | 11 | case "${c#name=}" in *Capture*|*Boost*) |
12 | ) | 12 | amixer -D "$DEV" cset "$a,$b,$c" "$SETME";; |
13 | esac | ||
14 | done | ||
15 | ) | ||
16 | } | ||
17 | |||
18 | hardware_devices() | ||
19 | { | ||
20 | arecord -L | | ||
21 | while IFS= read line; do | ||
22 | case "$line" in hw:*) | ||
23 | dev=${line##*DEV=} | ||
24 | echo hw:${dev%%,*} | ||
25 | ;; | ||
26 | esac | ||
27 | done | ||
28 | } | ||
29 | |||
30 | for dev in default $(hardware_devices); do | ||
31 | enable_recording $dev | ||
32 | done | ||