Search code examples
linuxbashaudioalsa

Setting system volume in a bash script (in linux)


I need to set the system volume in a bash script, but I have no idea how to do this. Should I use alsactl? Are there some values in /proc or /sys that I could use?


Solution

  • You should use the amixer tool.

    Run amixer without parameters to get a list of mixer controls.
    Use commands like this:

    amixer set Master 50%     # set absolute
    amixer set Master 2dB+    # set relative
    amixer set Master unmute