InputMixer decreases volume with multiple streams #2249
-
|
I noticed that when mixing 2 or more channels there is a noticable decrease in volume. After modifying the next function I have correct mixing without a change in volume, exactly what I expected and needed. The code that works for me in the InputMixer and that keeps all volumes as it should (for me): void resultAdd(float fact) { // Enabling the line below causes a decrease in volume. Volume is restored after 1 stream ends. Is it possible to tell me if I misunderstood the default configuration and that I need to use other weights or other settings? The issue resembles #763 but it is slightly different. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Int16 samples are in the range of negative 32768 through positive 32767. |
Beta Was this translation helpful? Give feedback.
Int16 samples are in the range of negative 32768 through positive 32767.
Mixing is just summing up the samples: if you are mixing 3 channels you need to divide each input by 3 to provent an numeric overflow or clipping and loosing info.