How to use a microphone on esp32

Hello, I was hoping someone could assist me in using a headset and an esp32 to route sound into from a microphone. I would greatly appreciate some assistance.

By utilizing the code and the explanations, I have already been able to use each of them individually, but I believe that I won’t be able to make them work together due to the libraries that are utilized. I started looking online to see if there was anything about it, but I was unsuccessful. Additionally, I’m utilizing platformIO and versus code. Additionally, an SD card won’t function with it, so I won’t be able to add one.

Additionally, we intend to control the volume with a potentiometer.

here is the esp32 explanations