mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 22:30:42 +02:00
Add AudioClient mixing gains for local injectors and system sounds
This commit is contained in:
parent
7311c3ac06
commit
e6c720f793
2 changed files with 7 additions and 1 deletions
|
@ -1366,7 +1366,9 @@ bool AudioClient::mixLocalAudioInjectors(float* mixBuffer) {
|
|||
memset(_localScratchBuffer, 0, bytesToRead);
|
||||
if (0 < injectorBuffer->readData((char*)_localScratchBuffer, bytesToRead)) {
|
||||
|
||||
float gain = injector->getVolume();
|
||||
bool isSystemSound = !injector->isPositionSet() && !injector->isAmbisonic();
|
||||
|
||||
float gain = injector->getVolume() * (isSystemSound ? _systemInjectorGain : _localInjectorGain);
|
||||
|
||||
if (injector->isAmbisonic()) {
|
||||
|
||||
|
|
|
@ -239,6 +239,8 @@ public slots:
|
|||
void setInputVolume(float volume, bool emitSignal = true);
|
||||
void setReverb(bool reverb);
|
||||
void setReverbOptions(const AudioEffectOptions* options);
|
||||
void setLocalInjectorGain(float gain) { _localInjectorGain = gain; };
|
||||
void setSystemInjectorGain(float gain) { _systemInjectorGain = gain; };
|
||||
|
||||
void outputNotify();
|
||||
|
||||
|
@ -393,6 +395,8 @@ private:
|
|||
int16_t* _outputScratchBuffer { NULL };
|
||||
|
||||
// for local audio (used by audio injectors thread)
|
||||
std::atomic<float> _localInjectorGain { 1.0f };
|
||||
std::atomic<float> _systemInjectorGain { 1.0f };
|
||||
float _localMixBuffer[AudioConstants::NETWORK_FRAME_SAMPLES_STEREO];
|
||||
int16_t _localScratchBuffer[AudioConstants::NETWORK_FRAME_SAMPLES_AMBISONIC];
|
||||
float* _localOutputMixBuffer { NULL };
|
||||
|
|
Loading…
Reference in a new issue