Sets volume via command line

Categories:  Linux
Labels:  terminal, tutorials, command, bash

This will increase the volume by 2 decibels on the pcm channel. the argument to -c is for which sound card to use, the arg after set is the channel (PCM, Master, etc.) and what to set by. Related commands:

Adjusts the ‘Master’ channel’s volume up by 2dB

Can use command ‘amixer’ to see other channels:

simple mixer control ‘Master’,0

or

simple mixer control ‘Capture’,0

$ amixer -c 0 set PCM 2dB+

Use to volume down

$ amixer -c 0 set PCM 2dB-

Or

$ amixer sset PCM 10%-
$ amixer sset PCM 10%+

This will decrease volume by 2 decibels

$ amixer -c 0 set PCM toggle

To toggle mute/unmute

$ (amixer get Master | grep off > /dev/null && amixer -q set Master unmute) || amixer -q set Master mute

This is for alsa systems

For mac os (and maybe other UNIX systems) osascript -e 'set Volume *' where * is any number (can have decimal points) between 0 and 10

Pulseaudio-ctl: vol+/- and mute from the shell or shortcut keys? :-)

This is much better then the amixer solution (amixer -D pulse sset Master 5%+), it lets me set the volume above 100% and with bad notebook speakers thats priceless

Glad you’re finding it useful. Enjoy! :)

Related Posts:

Social Profiles

Alvistec spanish
Plan Alvistec in Youtube
Privacy policy

This web site uses third's cookies and the Google's cookies to offer services, personalize ads and analyze traffic (Google analytics).
The information on the use of the this web site is shared with Google and another ads provider platforms. When you using this web site, you accept cookies use.
See more about the Cookies

This web accept cryptocoin donations
BTC address, LTC, ETH, Uphold:
Why donations?