Adjust Ringer for Android Automatically based on Noise level around you: Intelligent Ringer is a free app in Google Play store. It adjusts the ringer volume based on the ambient noise level in the room around you.
This is done by using the phone’s microphone to analyze the surrounding ambient noise level to set the volume of the ringtone accordingly. It is also able to detect whether the device is in a pocket or not, based on the proximity sensor readings.
There is also a calibrate option that you can use to find the ideal settings for your phone. If you want you can adjust its sensitivity and minimum volume to your own preferences. It is perfect for situations where you put your phone on silent or vibrate.