I'm trying to use amixer via system() calls in C++ to set the mic gain when my application is launched. However I cannot figure out the proper syntax to set an enum item in amixer. Sorry if this isn't 100% relevant to stack overflow as it might be more of a generic linux question than a programmming specific question.
from running amixer sget 'MIC GAIN':
[root@platform root]$ amixer sget 'MIC GAIN'
Simple mixer control 'MIC GAIN',0
Capabilities: enum
Items: '0dB' '20dB' '30dB' '40dB'
Item0: '20dB'
Attempting to set a new value:
[root@platform root]$ amixer sset 'MIC GAIN' '40db'
amixer: Invalid command!
The same result occurs if I replace 40db with integers 0-3, don't use quotes, etc. Any idea how I can make amixer change this value?