summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--volume.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/volume.c b/volume.c
index 7b82623e..24e876ff 100644
--- a/volume.c
+++ b/volume.c
@@ -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