mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 04:44:08 +02:00
constantize VOLUME_BASELINE in addProceduralSounds
This commit is contained in:
parent
274c810dec
commit
63a2b203d9
1 changed files with 2 additions and 1 deletions
|
@ -315,9 +315,10 @@ Audio::~Audio() {
|
|||
void Audio::addProceduralSounds(int16_t* inputBuffer, int numSamples) {
|
||||
const float MAX_AUDIBLE_VELOCITY = 6.0;
|
||||
const float MIN_AUDIBLE_VELOCITY = 0.1;
|
||||
const int VOLUME_BASELINE = 400;
|
||||
|
||||
float speed = glm::length(_lastVelocity);
|
||||
float volume = 400 * (1.f - speed / MAX_AUDIBLE_VELOCITY);
|
||||
float volume = VOLUME_BASELINE * (1.f - speed / MAX_AUDIBLE_VELOCITY);
|
||||
|
||||
// Add a noise-modulated sinewave with volume that tapers off with speed increasing
|
||||
if ((speed > MIN_AUDIBLE_VELOCITY) && (speed < MAX_AUDIBLE_VELOCITY)) {
|
||||
|
|
Loading…
Reference in a new issue