Skip to content
This repository was archived by the owner on Dec 21, 2025. It is now read-only.

Commit 9138c3a

Browse files
committed
FIX/Patterns: don't play audio track before bezier setup
1 parent 32d071b commit 9138c3a

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/js/artwork/Patterns.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,13 @@ class Patterns {
672672
continue() {
673673
this._renderer.setAnimationLoop(this._renderLoop.bind(this));
674674
this._clock.start();
675+
if (
676+
patternsLogic.values.state === PATTERNS_STATES.INIT ||
677+
patternsLogic.values.state === PATTERNS_STATES.BEZIER_SETUP ||
678+
patternsLogic.values.state === PATTERNS_STATES.PREPARE
679+
) {
680+
return;
681+
}
675682
this._patternTracks.map((pt) => pt.audio.play());
676683
this._audioStartedAt = this._patternTracks[0]?.audio?.context.currentTime;
677684
}

src/js/artwork/PatternsUI.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,9 @@ const PatternsUI = ({ paused }) => {
2626
if (canvasRef.current && canvasWrapperRef.current) {
2727
init(new Patterns(canvasRef.current, canvasWrapperRef.current));
2828
}
29-
return () => {
30-
// canvasRef.current.removeEventListener("pointermove", pointerMoveListener);
31-
// canvasRef.current.removeEventListener("pointerdown", pointerDownListener);
32-
// canvasRef.current.removeEventListener("pointerup", pointerUpListener);
33-
};
3429
}, []);
3530

3631
useEffect(() => {
37-
console.log("PAUSED: ", paused);
3832
if (artwork && paused) {
3933
artwork.pause();
4034
}

0 commit comments

Comments
 (0)