diff --git a/Util/Audio/OfflineAudioMixer.cs b/Util/Audio/OfflineAudioMixer.cs index 3a75643..cb2496a 100644 --- a/Util/Audio/OfflineAudioMixer.cs +++ b/Util/Audio/OfflineAudioMixer.cs @@ -87,7 +87,7 @@ namespace ADOFAIRenderer.Util.Audio // Target Audio Settings private readonly int _targetChannels; private readonly int _targetSampleRate; - private const float MasterVolume = 1f; + private const float ClipVolume = 1f; // Audio Filter Settings private readonly LinkedList _filters = new(); @@ -272,7 +272,7 @@ namespace ADOFAIRenderer.Util.Audio if (idxHigh >= totalSamples) idxHigh = totalSamples - 1; if (idxLow >= totalSamples) idxLow = totalSamples - 1; - for (int c = 0; c < _targetChannels; c++) + for (var c = 0; c < _targetChannels; c++) { float valLow = _bgmSamples[idxLow * _targetChannels + c]; float valHigh = _bgmSamples[idxHigh * _targetChannels + c]; @@ -334,11 +334,12 @@ namespace ADOFAIRenderer.Util.Audio if (idxHigh >= totalSamples) idxHigh = totalSamples - 1; if (idxLow >= totalSamples) idxLow = totalSamples - 1; - for (int c = 0; c < _targetChannels; c++) + for (var c = 0; c < _targetChannels; c++) { float valLow = clipData.Samples[idxLow * _targetChannels + c]; float valHigh = clipData.Samples[idxHigh * _targetChannels + c]; - mixedBuffer[s * _targetChannels + c] += (valLow + t * (valHigh - valLow)) * ev.Volume * MasterVolume; + mixedBuffer[s * _targetChannels + c] += (valLow + t * (valHigh - valLow)) * ev.Volume + * ClipVolume * 2 / 3; } }