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

Minor playback bugs: #37

Open
jrkatz opened this issue Dec 17, 2020 · 0 comments
Open

Minor playback bugs: #37

jrkatz opened this issue Dec 17, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@jrkatz
Copy link
Owner

jrkatz commented Dec 17, 2020

To enable toggling of repeat as late as possible, we speculatively schedule clicks past the end of the track - the beats that would play if repeat is enabled - and after the last click in the track we check the repeat state and either continue or stop the audio context.

If the audio of the last beat is long enough that it lasts past the end of the track (i.e., the click is a 0.1s sample played 0.05s before the end of the track) - or at least near enough the end the event loop doesn't make a tick before the end of the track - and repeat is disabled, the speculatively scheduled 'start over' clicks may play some audio before the audio context is stopped.

We can get around this by checking the repeat state as of the scheduling of the last beat and declining to speculatively schedule beats. So doing, the 'repeat' button will feel less responsive - there's a window where its state can be toggled before the end of a track and the effect will not be felt. It might be worth it for more perfect audio. In any case it should be made as small a window as possible.

@jrkatz jrkatz added the bug Something isn't working label Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant