logarithmic volume scaling

This commit is contained in:
badaix 2016-01-08 08:56:32 +01:00
parent 80ea2a37a3
commit 0f90f05e9d

View file

@ -17,8 +17,11 @@
***/
#include <iostream>
#include <cmath>
#include "player.h"
#include "common/log.h"
using namespace std;
@ -61,7 +64,9 @@ void Player::stop()
void Player::setVolume(double volume)
{
volume_ = volume;
double base = 10.;
volume_ = (pow(base, volume)-1) / (base-1);
logD << "setVolume: " << volume << " => " << volume_ << "\n";
}