mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-28 22:07:51 +02:00
log e based volume
This commit is contained in:
parent
5dbf4aaaa4
commit
0092f79f88
1 changed files with 3 additions and 1 deletions
|
@ -81,9 +81,11 @@ void Player::adjustVolume(char* buffer, size_t frames)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//http://stackoverflow.com/questions/1165026/what-algorithms-could-i-use-for-audio-volume-level
|
||||||
void Player::setVolume(double volume)
|
void Player::setVolume(double volume)
|
||||||
{
|
{
|
||||||
double base = 10.;
|
double base = M_E;
|
||||||
|
// double base = 10.;
|
||||||
volume_ = (pow(base, volume)-1) / (base-1);
|
volume_ = (pow(base, volume)-1) / (base-1);
|
||||||
logD << "setVolume: " << volume << " => " << volume_ << "\n";
|
logD << "setVolume: " << volume << " => " << volume_ << "\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue