Go to
System Preferences then Keyboard and click Shortcuts then Custom Shortcuts:
Click on Add
Fill in:
Toggle microphone
and
amixer set Capture toggle
For usb webcams you need to chose device (-c 1), or maybe another number.
amixer -c 1 sset Mic toggle
Click Apply and then associate a new key with this command (e.g. the Pause/Break key).
If you are using ALSA, amixer can be helpful for your script programming.
When dropping the amixer --help
command in a terminal you will see something like this:
Depending on your soundcard, levels may be different than mine, but you can use alsamixer
in the terminal in order to check which levels and which features in your sound card you can call in a command to set the volume as you wish.
In my example, with my principal sound card (I have 2: the embedded and a PCI audio card), levels are from 0 to 100, this way I can change the volume of a desired input/output in my soundcard by dropping in a terminal the next command:
amixer -c 0 set Front 50DB
amixer -c 0 set Front 64DB
In the first command, the result will set the Front panel output to 78% level and the second one will set the Front panel output to 100% level.
In order to gather information related to your mixer controls, drop the amixer
command with no parameters and you will get a list. Or indicate which audio device you wish to see a list of controls with amixer -c X
(where "X" is the number of your audio device).
BTW: Remember that DB values are calculated logarithmically and not linearly.
Best Answer
By using the Pulseaudio Command Line Interface we will obtain a lot of information on available 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 validTo set an output to a defined value we need to know it's index which is also given by
list-sources
to issueWe may also need to unmute the sink source with