Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transport-synced Player continues to play after Transport.pause() #1289

Open
AndreyMay opened this issue Nov 17, 2024 · 0 comments
Open

Transport-synced Player continues to play after Transport.pause() #1289

AndreyMay opened this issue Nov 17, 2024 · 0 comments

Comments

@AndreyMay
Copy link

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

  1. Create a Player with audio (couple of seconds long)
  2. Sync Player to Transport via .sync().start(5)
  3. Start the Transport and pause around second 5. Try values between 4.9 and 5.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); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant