I need to change my volume on my USB sound card (which is the default card) via the command line. I know alsamixer will do that but I need it to be a one line command so I can use it in a python script, e.g., os.system("volume up 1"), or something like that. Is there any way to do this?
Asked
Active
Viewed 2.4k times
6
goldilocks
- 60,325
- 17
- 117
- 234
Patrick Cook
- 6,365
- 8
- 38
- 63
1 Answers
4
Create a Bash file with the following code:
amixer scontrols amixer sset 'Master' 50%Make the Bash file executable using
chmod +x filenameIn Python, use the following:
import os os.system("directorytobashfile/file")
Bex
- 2,929
- 3
- 26
- 34
Kachamenus
- 749
- 6
- 26