P5-R3: fix count-in recursion + test buffer loop size
Lint & Validate / lint (push) Has been cancelled
Lint & Validate / lint (push) Has been cancelled
This commit is contained in:
@@ -639,7 +639,7 @@ class BackingTrackPlayer:
|
|||||||
|
|
||||||
if ptype == ParameterType.PLAY:
|
if ptype == ParameterType.PLAY:
|
||||||
if value > 0.5:
|
if value > 0.5:
|
||||||
return self.play()
|
return self.play(count_in=False)
|
||||||
else:
|
else:
|
||||||
return self.stop()
|
return self.stop()
|
||||||
|
|
||||||
|
|||||||
@@ -1628,7 +1628,9 @@ class TestCountInIntegration:
|
|||||||
assert player._count_in_remaining > 0 # noqa: SLF001
|
assert player._count_in_remaining > 0 # noqa: SLF001
|
||||||
|
|
||||||
# Process until count-in completes
|
# Process until count-in completes
|
||||||
for _ in range(50):
|
# 1 bar × 4 beats × (60/120)s = 2.0s count-in
|
||||||
|
# 2.0s / (256 frames / 48000 Hz) ≈ 375 buffers needed
|
||||||
|
for _ in range(400):
|
||||||
buf = player.process_buffer(256)
|
buf = player.process_buffer(256)
|
||||||
if player.is_playing:
|
if player.is_playing:
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user