You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there's no supported API that a user can use to provide the Web Audio AudioContext object that Flocking should use instead of creating its own. This should be an option that can be provided to an flock.environ component, and via a call to flock.init() for those in the imperative mindset.
For now, luckily, there is a workaround. Flocking stores its AudioContext as a singleton in a global variable, flock.webAudio.audioSystem.audioContextSingleton. Assigning an AudioContext instance to this variable prior to initializing Flocking will cause it to use that context instead of creating its own. For example:
var ac = new AudioContext();
flock.webAudio.audioSystem.audioContextSingleton = ac;
flock.init();
The text was updated successfully, but these errors were encountered:
Currently, there's no supported API that a user can use to provide the Web Audio AudioContext object that Flocking should use instead of creating its own. This should be an option that can be provided to an
flock.environ
component, and via a call toflock.init()
for those in the imperative mindset.For now, luckily, there is a workaround. Flocking stores its AudioContext as a singleton in a global variable,
flock.webAudio.audioSystem.audioContextSingleton
. Assigning an AudioContext instance to this variable prior to initializing Flocking will cause it to use that context instead of creating its own. For example:The text was updated successfully, but these errors were encountered: