Equalize Speaker using impulse response
This depends a bit on what you want to get out of this and how much effort/work  you are willing to put in.

Doing a room EQ that actually works and makes it sound consistently better is quite complicated. There are commercial systems available but they tend to be complicated and expensive or tied to a specific product.

A really good freeware option to play around with is Room EQ Wizard https://www.roomeqwizard.com/ 

If you want to do this yourself, I suggest you break it down in a few separate steps that can be tackled individually


Figure out how to make a good measurement in a room (noise, reverb, microphone, ADC, SNR estimation, etc.)
Figure out what to measure (using the tools from step 1) that's representative enough of the entire room/speaker/listener situation
Extract perceptually relevant parameters from these measurements
Turn these parameters into some sort of correction that would move the parameters towards some perceptual target
Design a filter and/or algorithm based on this correction
Design the process/HW/system to actually implement and apply the filter or correction


All of these steps have been studied in detail and there is a fair bit of literature available on any of them.