Moved master volume as a final pass before passing it to the driver

This commit is contained in:
KiritoDv
2026-01-09 09:16:56 -06:00
parent 59fdcee9bf
commit ef04aec3aa
2 changed files with 6 additions and 5 deletions
-5
View File
@@ -1496,11 +1496,6 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, f32 pan, u8 reverb
velocity = 0;
}
float master_vol = CVarGetInteger("gSettings.Volume.Master", 100) / 100.0f;
volLeft *= master_vol;
volRight *= master_vol;
#ifdef VERSION_JP
note->targetVolLeft = (u16)(velocity * volLeft) & ~0x80FF; // 0x7F00, but that doesn't match
note->targetVolRight = (u16)(velocity * volRight) & ~0x80FF;
+6
View File
@@ -400,6 +400,12 @@ void GameEngine::HandleAudioThread() {
create_next_audio_buffer(audio_buffer + i * (num_audio_samples * 2), num_audio_samples);
}
float master_vol = CVarGetInteger("gSettings.Volume.Master", 100) / 100.0f;
for (u32 i = 0; i < SAMPLES_PER_FRAME; i++) {
audio_buffer[i] = static_cast<s16>(audio_buffer[i] * master_vol);
}
AudioPlayerPlayFrame((u8*)audio_buffer, 2 * num_audio_samples * 4);
audio.processing = false;