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
37429a07b8
commit
155bd39da6
1 changed files with 4 additions and 0 deletions
|
@ -433,6 +433,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);
|
||||
}
|
||||
});
|
||||
|
@ -450,6 +452,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