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
5
namespace
nanommo
{
6
7
namespace
{
8
9
constexpr
float
kRangeDecibels = 40.0f;
10
11
}
// namespace
12
13
float
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
nanommo
Definition
chat.cc:9
nanommo::Gain
float Gain(float slider)
Definition
sound.cc:13
sound.h
client
sound.cc
Generated by
1.15.0