Created
March 26, 2018 03:17
-
-
Save rwrrll/96b20f161f6c08027839cd3627e09382 to your computer and use it in GitHub Desktop.
dB / volume conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float dbToVolume(float dB) | |
{ | |
return powf(10.0f, 0.05f * dB); | |
} | |
float volumeTodB(float volume) | |
{ | |
return 20.0f * log10f(volume); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment