diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-09-18 20:11:47 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-09-18 20:11:47 +0200 |
commit | 58a5a39c7efaf146889b04df0fcf107e432772a7 (patch) | |
tree | 46e7989ecfd39f7e63bacf628b41e5f3c2b50324 | |
parent | d8b1b65d322a47febfe20578fd7270d56c212eb8 (diff) |
faster version of volume dB conversion routine
-rw-r--r-- | volume.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -64,7 +64,10 @@ volume_get_amp (void) { float db_to_amp (float dB) { - return pow (10, dB/20.f); +// return pow (10, dB/20.f); + // thanks to he for this hack + const float ln10=2.3025850929940002f; + return exp(ln10*dB/20.f); } float |