feat: StartOffset

- 实现startOffset
- 修复EndOffset = 0 + 循环播放时,音乐会大量重复播放的错误。
- 增加数据校验和 BeatClock 联动。StartOffset不正确时停止bar+级 callback。
- BeatClock 现在会在每次重新播放时重启,以解决EndOffset配置错误被舍弃时,拍子对不上的问题。
This commit is contained in:
2026-05-12 15:47:04 +08:00
parent bb472da311
commit 8b6fabda12
10 changed files with 143 additions and 60 deletions
@@ -29,7 +29,7 @@ namespace OCES.Audio
internal void Restart(MusicContainer container, float inheritedBpm, double dspTime, double startOffset = 0d)
{
//Debug.Log($"[BeatClock] Restarting {container.Id}, inheritedBpm = {inheritedBpm}, dspTime = {dspTime}");
Debug.Log($"[BeatClock] Restarting {container.Id}, inheritedBpm = {inheritedBpm}, dspTime = {dspTime}");
StopAll();
this.m_blendError = this.m_stopped = false;
this.m_containerId = container.Id;