Fix worklets not loading
This commit is contained in:
parent
920776fdfe
commit
908c0e44ff
6 changed files with 28 additions and 23 deletions
|
|
@ -348,7 +348,7 @@ export function applyFM(param, value, begin) {
|
|||
duration,
|
||||
} = value;
|
||||
let modulator;
|
||||
let stop = () => {};
|
||||
let stop = () => { };
|
||||
|
||||
if (fmModulationIndex) {
|
||||
const ac = getAudioContext();
|
||||
|
|
|
|||
|
|
@ -208,11 +208,11 @@ export function registerWorklet(url) {
|
|||
}
|
||||
|
||||
let workletsLoading;
|
||||
function loadWorklets() {
|
||||
export function loadWorklets() {
|
||||
if (!workletsLoading) {
|
||||
const audioCtx = getAudioContext();
|
||||
const allWorkletURLs = externalWorklets.concat([workletsUrl]);
|
||||
workletsLoading = Promise.all(allWorkletURLs.map((workletURL) => audioCtx.audioWorklet.addModule(workletURL)));
|
||||
workletsLoading = Promise.all(allWorkletURLs.map((workletURL) => audioCtx.audioWorklet.addModule(workletURL))).then(() => workletsLoading = undefined);
|
||||
}
|
||||
|
||||
return workletsLoading;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue