Skip to content

Commit

Permalink
actually, *really*, fix beat event synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNathannator committed Jul 8, 2024
1 parent 1b21150 commit 3976a42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Assets/Script/Gameplay/GameManager.Loading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ private async void Start()

// TODO: Move the offset here to SFX configuration
// The clap SFX has 20 ms of lead-up before the actual impact happens
BeatEventHandler.Subscribe(StarPowerClap, -0.02);
// Must be offset by audio calibration to account for playback delay
BeatEventHandler.Subscribe(StarPowerClap, -0.02 + _songRunner.AudioCalibration);

// Log constant values
YargLogger.LogFormatDebug("Audio calibration: {0}, video calibration: {1}, song offset: {2}",
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Gameplay/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private void Update()

// Update handlers
_songRunner.Update();
BeatEventHandler.Update(_songRunner.RealSongTime);
BeatEventHandler.Update(_songRunner.SongTime);

// Update players
int totalScore = 0;
Expand Down

0 comments on commit 3976a42

Please sign in to comment.