nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
sound.cc
Go to the documentation of this file.
1#include "client/sound.h"
2
3#include <cmath>
4
5namespace nanommo {
6
7namespace {
8
9constexpr float kRangeDecibels = 40.0f;
10
11} // namespace
12
13float Gain(float slider) {
14 if (slider <= 0.0f) {
15 return 0.0f;
16 }
17 // Twenty decibels are ten times the amplitude.
18 return std::pow(10.0f, (slider - 1.0f) * kRangeDecibels / 20.0f);
19}
20
21} // namespace nanommo
Definition chat.cc:9
float Gain(float slider)
Definition sound.cc:13