Skip to content

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.

2 participants