DB meter intergration

I am looking for a way to use something like an old phone as a decibel meter. Doesn’t have to be exact but I am making a system to change the tv volume depending on the rough noise level in the room