Apps listening to your mic to give you targeted ads is an urban legend. There's tools to see which apps listen to you and there isn't any evidence that any of the popular stuff ever open the microphone (unless you're in a call or something). If you're too worried about it, you can always turn off the mic permission for the app.
The ads are actually coming from other ways of tracking you like browser fingerprinting to follow what things you browse and build a profile on what you like/are interested in.
See also EFF's article on it: https://www.digitalrightsbytes.org/topics/is-my-phone-listening-to-me