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

Clear isLoaded flag in setTune #927

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

rcbilson
Copy link

I was attempting to update a synth controller in the background by running something like

synthControl.setTune(visualObj, false);

However, after I played the tune once any further calls to setTune would have no effect on the synth controller. This is because the isLoaded flag is not cleared by setTune, and when userAction is false the isLoaded flag causes the deferred call to go (in runWhenReady) to be skipped.

Solution: clear the isLoaded flag in setTune.

@paulrosen
Copy link
Owner

I'll look at this in a couple weeks. This can be tricky - browsers really want audio to be manipulated after a user interaction. I would suggest having a global click handler and starting your audio processing after the user has interacted with the page

I've had to go through a bunch of hoops to get audio to place in my client apps. In particular, iOS can be really finicky. Code that runs on Safari on OSX sometimes doesn't run on Safari iOS.

Anyway, make sure you test on iPhone!

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

Successfully merging this pull request may close these issues.

None yet

2 participants