Adjusting the Microphone Gain with code

I saw that I can control my microphones Gain without having to build a pre-amplifier as it says on one of the datasheets : MT2502A SOC Processor Technical Brief. on Page 11.

And i am looking for some guidance in how to do that with a piece of code example or suggestion.

Thank you;

ALSA Library Mixer interface https://www.alsa-project.org/alsa-doc/alsa-lib/index.html