foxygit / fake-08-xbox360 Log in
commit ab8a765ba0bf2bb16147f740470189873783baca
Author:     Jon Bell <jondbell@protonmail.com>
AuthorDate: Mon Jun 8 13:57:41 2020 -0600
Commit:     Jon Bell <jondbell@protonmail.com>
CommitDate: Mon Jun 8 13:57:41 2020 -0600

    Lower audio volume and avoid clipping
---
 source/Audio.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source/Audio.cpp b/source/Audio.cpp
index 71a76b5..ea0b9e9 100644
--- a/source/Audio.cpp
+++ b/source/Audio.cpp
@@ -273,7 +273,8 @@ void Audio::FillAudioBuffer(void *audioBuffer, size_t offset, size_t size){
         int16_t sample = 0;

         for (int c = 0; c < 4; ++c) {
-            sample += this->getSampleForChannel(c);
+            //bit shifted 3 places to lower volume and avoid clipping
+            sample += this->getSampleForChannel(c) >> 3;
         }

         //buffer is stereo, so just send the mono sample to both channels