mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 20:42:56 +02:00
Quantize and limit the local injector gains to match the network protocol
This commit is contained in:
parent
37429a07b8
commit
155bd39da6
1 changed files with 4 additions and 0 deletions
|
@ -433,6 +433,8 @@ void Audio::setLocalInjectorGain(float gain) {
|
||||||
_localInjectorGain = gain;
|
_localInjectorGain = gain;
|
||||||
// convert dB to amplitude
|
// convert dB to amplitude
|
||||||
gain = fastExp2f(gain / 6.02059991f);
|
gain = fastExp2f(gain / 6.02059991f);
|
||||||
|
// quantize and limit to match NodeList::setInjectorGain()
|
||||||
|
gain = unpackFloatGainFromByte(packFloatGainToByte(gain));
|
||||||
DependencyManager::get<AudioClient>()->setLocalInjectorGain(gain);
|
DependencyManager::get<AudioClient>()->setLocalInjectorGain(gain);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -450,6 +452,8 @@ void Audio::setSystemInjectorGain(float gain) {
|
||||||
_systemInjectorGain = gain;
|
_systemInjectorGain = gain;
|
||||||
// convert dB to amplitude
|
// convert dB to amplitude
|
||||||
gain = fastExp2f(gain / 6.02059991f);
|
gain = fastExp2f(gain / 6.02059991f);
|
||||||
|
// quantize and limit to match NodeList::setInjectorGain()
|
||||||
|
gain = unpackFloatGainFromByte(packFloatGainToByte(gain));
|
||||||
DependencyManager::get<AudioClient>()->setSystemInjectorGain(gain);
|
DependencyManager::get<AudioClient>()->setSystemInjectorGain(gain);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue