Microphone Activation via Button

I wanted help to know if there is any way of using the button to activate and deactivate the microphone to do a push to talk through the hardware. That is, while the button is not pressed the microphone should be disabled, when the button is pressed the microphone is activated. I just saw something similar to Google Assistant, but I don’t use Google Assistant in my application. I am using the Respeaker 2-mic Pi Hat with Raspberry Pi Zero-W.

Hi @Filippo_Andrade ,
ReSpeaker 2-Mics HAT had two mics and stereo codec ic. without storage function.
I think you can control to take capture or ignore by application code.