-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Describe the bug
Transport-synced Player continues to play the full audio loaded into the Player after Transport.pause(). It happens when the Transport.pause() is triggered ~exactly at/near the beginning of Player.sync().start(5)
time (i.e. second 5 in this example).
It seems like the event is scheduled and schedule is not cleared in this case. Potentially related to latencyHint timing? (using defaults).
To Reproduce
- Create a Player with audio (couple of seconds long)
- Sync Player to Transport via
.sync().start(5)
- Start the Transport and pause around second 5. Try values between
4.9
and5.1
Expected behavior
When Transport.pause()
is called all audio should stop playing.
What I've tried
In Source.ts
-> start()
I've added a state check before calling _start()
and that seem to help.
But maybe it's introducing some other issues as I've noticed now sometimes synced Players ahead on the timeline are not playing (?)
const sched = this.context.transport.schedule((t) => {
if (this.state === "started") {
this._start(t, offset, duration);
} else {
this.log(">>> [source.start] BLOCKED: transport.state !== 'started':", this.state, t);
}
}, computedTime);
Metadata
Metadata
Assignees
Labels
No labels