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