Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Fixed framespikes fucking with audio
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Dec 27, 2023
1 parent 97b4a63 commit ff0497c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Managers/AudioMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ namespace RTE {

float globalPitch = 1.0F;

float simSpeed = g_TimerMan.GetSimSpeed();
float timeScale = g_TimerMan.GetTimeScale();
// Soften the ratio of the pitch adjustment so it's not such an extreme effect on the audio.
// TODO: This coefficient should probably move to SettingsMan and be loaded from ini. That way this effect can be lessened or even turned off entirely by users. 0.35 is a good default value though.
globalPitch = simSpeed + (1.0F - simSpeed) * 0.35F;
globalPitch = timeScale + (1.0F - timeScale) * 0.35F;

SetGlobalPitch(globalPitch);

Expand Down

0 comments on commit ff0497c

Please sign in to comment.