We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d795d3b + d72d035 commit 1d83317Copy full SHA for 1d83317
src/audioWorklet/index.js
@@ -9,12 +9,14 @@ let initializedAudioWorklets = false;
9
10
function loadAudioWorkletModules() {
11
return Promise.all(
12
- moduleSources.map(function (moduleSrc) {
+ moduleSources.map(function(moduleSrc) {
13
const blob = new Blob([moduleSrc], { type: 'application/javascript' });
14
const objectURL = URL.createObjectURL(blob);
15
- return ac.audioWorklet.addModule(objectURL);
16
- })
17
- );
+ return ac.audioWorklet
+ .addModule(objectURL)
+ // in "p5 instance mode," the module may already be registered
18
+ .catch(() => Promise.resolve());
19
+ }));
20
}
21
22
p5.prototype.registerMethod('init', function () {
0 commit comments