fix certain types of sounds firing a frame late

This commit is contained in:
minenice55
2024-01-24 00:17:35 -05:00
parent 23d9edf5fe
commit b94a70fbc6
5 changed files with 74 additions and 52 deletions

View File

@ -189,6 +189,7 @@ namespace HeavenStudio
RiqBeatmap chart = GameManager.instance.Beatmap;
double offset = chart.data.offset;
double dspTime = AudioSettings.dspTime;
dspStart = dspTime;
startPos = GetSongPosFromBeat(beat);
firstBeatOffset = offset;
@ -213,10 +214,6 @@ namespace HeavenStudio
musicSource.pitch = timelinePitch;
Debug.Log($"playback scheduled for dsptime {dspStart}");
}
if (musicSource.clip == null)
{
dspStart = dspTime;
}
songPosBeat = beat;
startBeat = songPosBeat;
@ -404,7 +401,7 @@ namespace HeavenStudio
}
}
double MapTimeToPitchChanges(double time)
public double MapTimeToPitchChanges(double time)
{
double counter = 0;
double lastChangeTime = 0;