SHA256
Adjust Hitsound Volume
This commit is contained in:
1 file changed
+5
-4
@@ -87,7 +87,7 @@ namespace ADOFAIRenderer.Util.Audio
|
|||||||
// Target Audio Settings
|
// Target Audio Settings
|
||||||
private readonly int _targetChannels;
|
private readonly int _targetChannels;
|
||||||
private readonly int _targetSampleRate;
|
private readonly int _targetSampleRate;
|
||||||
private const float MasterVolume = 1f;
|
private const float ClipVolume = 1f;
|
||||||
|
|
||||||
// Audio Filter Settings
|
// Audio Filter Settings
|
||||||
private readonly LinkedList<IAudioFilter> _filters = new();
|
private readonly LinkedList<IAudioFilter> _filters = new();
|
||||||
@@ -272,7 +272,7 @@ namespace ADOFAIRenderer.Util.Audio
|
|||||||
if (idxHigh >= totalSamples) idxHigh = totalSamples - 1;
|
if (idxHigh >= totalSamples) idxHigh = totalSamples - 1;
|
||||||
if (idxLow >= totalSamples) idxLow = 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 valLow = _bgmSamples[idxLow * _targetChannels + c];
|
||||||
float valHigh = _bgmSamples[idxHigh * _targetChannels + c];
|
float valHigh = _bgmSamples[idxHigh * _targetChannels + c];
|
||||||
@@ -334,11 +334,12 @@ namespace ADOFAIRenderer.Util.Audio
|
|||||||
if (idxHigh >= totalSamples) idxHigh = totalSamples - 1;
|
if (idxHigh >= totalSamples) idxHigh = totalSamples - 1;
|
||||||
if (idxLow >= totalSamples) idxLow = 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 valLow = clipData.Samples[idxLow * _targetChannels + c];
|
||||||
float valHigh = clipData.Samples[idxHigh * _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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user