Ubuntu – How do i find exact status of the microphone mute or unmute or the volume level of mic using command line

11.0411.10alsacommand linepulseaudio

This is very odd, i have one default microphone and i have another second microphone. When i use this command it always shows not muted but the microphone volume is 0%. How or what is a way i can find those value accurately.

$ pactl list | sed -n '/^Source/,/^$/p' | grep Mute
    Mute: no
    Mute: no
    Mute: no

Best Answer

By using the Pulseaudio Command Line Interface we will obtain a lot of information on available sources

pacmd list-sources

will display a rather lengthy list. The current active input is marked with an asterisk. We could combine this with grep but will then lose information for which source the outputs are valid

pacmd list-sources | grep volume

To set an output to a defined value we need to know it's index which is also given by list-sources to issue

pacmd set-source-volume <index> <value> # value: 0 = mute 65536 = 100%

We may also need to unmute the sink source with

pacmd set-source-mute <index> 0