ミュートアンミュートスクリプトを修正

以前Awesome wmでボリュームコントロールをするのにscriptを書いてこれまで使っていました.

しかし,最近アンミュートにしても音が出なくなりました.

amixerではonになっているけど音が出ない
$ amixer -c 0 get Master
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 36 [41%] [-38.25dB] [on]

pavucontrolで見るとミュートになっています.

pavucontrol mute

これをアンミュートすると音が出ます.
scriptで制御できるようコマンドで試します. pactl set-sink-mute コマンドで制御できました.

$ pactl set-sink-mute
You have to specify a sink name/index and a mute action (0, 1, or 'toggle')
$ pactl set-sink-mute 0 1 (1)
$ pactl set-sink-mute 0 0 (2)
  1. ミュート
  2. アンミュート

ということでscriptに追記しました.動作も問題なさそうです.これでビデオチャット時にアンミュートしたのに音が聞こえない??とならないといいな.

$ git -C ~/.config/awesome/ diff ~/.config/awesome/bin/awesome-audio.sh
diff --git a/bin/awesome-audio.sh b/bin/awesome-audio.sh
index 440f399..9c30d3d 100755
--- a/bin/awesome-audio.sh
+++ b/bin/awesome-audio.sh
@@ -22,6 +22,7 @@ case "$1" in
       amixer -q -c 0 set Master unmute
       amixer -q -c 0 set Speaker unmute
       amixer -q -c 0 set Headphone unmute
+      pactl set-sink-mute 0 0
       xset b
       echo -e "🔊\nunmute!"
       amixer -c 0 get Master | tail -1 | cut -d '[' -f 2 | sed s/\]// | xargs notify-send -u low -t 500 -i '/usr/share/icons/ContrastHigh/scalable/status/audio-volume-high.svg' numute
環境
$ dpkg-query -W pulseaudio pulseaudio-utils pavucontrol alsa-utils
alsa-utils      1.2.4-1
pavucontrol     4.0-2
pulseaudio      14.2-1
pulseaudio-utils        14.2-1
$ lsb_release -dr
Description:    Debian GNU/Linux bullseye/sid
Release:        unstable
$ uname -m
x86_64

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.