In sound measurement, decibels (dB) quantify sound intensity relative to a reference level.
For instance, common reference level is standard air pressure 1 Pascal (Pa)
Practically, this reference can vary based on some factors (e.g- microphone sensitivity, calibration).
The formula dB = 20 * log10 (averageVolume / reference) estimates dB based on the average volume received from your microphone.
Note: This provides a simplified view. Real-world applications may require adjustments for accuracy.