Command line to set audio volume

So we can see out audio settings by using the alsa command:

[carleshf@earth ~]$ amixer -D pulse
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 32360 [49%] [on]
  Front Right: Playback 32360 [49%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 16462 [25%] [on]
  Front Right: Capture 16462 [25%] [on]

So we can see that the volume range goes from 0 to 65536. In this range a 5% takes the value 3276.8, so by running …

amixer -D pulse set Master 3276+ unmute

… we are increasing a 5% the actual volume, and by running …

amixer -D pulse set Master 3276- unmute

… we are decreasing it. Moreover we can use …

amixer -D pulse set Master toggle

… to toggle between mute and unmute.

DISCLAIMER: I’m running a linux mint system with openbox.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: