@grame/faustwasm 0.0.50 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -140,18 +140,19 @@ const createFaustNode = async (audioContext, dspName = "template", voices = 0) =
140
140
  /** @type {FaustDspDistribution} */
141
141
  const faustDsp = { dspMeta, dspModule };
142
142
 
143
- // Try to load optional mixer and effect modules
144
- try {
145
- faustDsp.mixerModule = await WebAssembly.compileStreaming(await fetch("./mixerModule.wasm"));
146
- faustDsp.effectMeta = await (await fetch(`./${dspName}_effect.json`)).json();
147
- faustDsp.effectModule = await WebAssembly.compileStreaming(await fetch(`./${dspName}_effect.wasm`));
148
- } catch (e) { }
149
-
150
143
  /** @type {FaustAudioWorkletNode} */
151
144
  let faustNode;
152
145
 
153
146
  // Create either a polyphonic or monophonic Faust audio node based on the number of voices
154
147
  if (voices > 0) {
148
+
149
+ // Try to load optional mixer and effect modules
150
+ try {
151
+ faustDsp.mixerModule = await WebAssembly.compileStreaming(await fetch("./mixerModule.wasm"));
152
+ faustDsp.effectMeta = await (await fetch(`./${dspName}_effect.json`)).json();
153
+ faustDsp.effectModule = await WebAssembly.compileStreaming(await fetch(`./${dspName}_effect.wasm`));
154
+ } catch (e) { }
155
+
155
156
  const generator = new FaustPolyDspGenerator();
156
157
  faustNode = await generator.createNode(
157
158
  audioContext,
@@ -140,18 +140,19 @@ const createFaustNode = async (audioContext, dspName = "template", voices = 0) =
140
140
  /** @type {FaustDspDistribution} */
141
141
  const faustDsp = { dspMeta, dspModule };
142
142
 
143
- // Try to load optional mixer and effect modules
144
- try {
145
- faustDsp.mixerModule = await WebAssembly.compileStreaming(await fetch("./mixerModule.wasm"));
146
- faustDsp.effectMeta = await (await fetch(`./${dspName}_effect.json`)).json();
147
- faustDsp.effectModule = await WebAssembly.compileStreaming(await fetch(`./${dspName}_effect.wasm`));
148
- } catch (e) { }
149
-
150
143
  /** @type {FaustAudioWorkletNode} */
151
144
  let faustNode;
152
145
 
153
146
  // Create either a polyphonic or monophonic Faust audio node based on the number of voices
154
147
  if (voices > 0) {
148
+
149
+ // Try to load optional mixer and effect modules
150
+ try {
151
+ faustDsp.mixerModule = await WebAssembly.compileStreaming(await fetch("./mixerModule.wasm"));
152
+ faustDsp.effectMeta = await (await fetch(`./${dspName}_effect.json`)).json();
153
+ faustDsp.effectModule = await WebAssembly.compileStreaming(await fetch(`./${dspName}_effect.wasm`));
154
+ } catch (e) { }
155
+
155
156
  const generator = new FaustPolyDspGenerator();
156
157
  faustNode = await generator.createNode(
157
158
  audioContext,
@@ -27,18 +27,19 @@ const createFaustNode = async (audioContext, dspName = "template", voices = 0) =
27
27
  /** @type {FaustDspDistribution} */
28
28
  const faustDsp = { dspMeta, dspModule };
29
29
 
30
- // Try to load optional mixer and effect modules
31
- try {
32
- faustDsp.mixerModule = await WebAssembly.compileStreaming(await fetch("./mixerModule.wasm"));
33
- faustDsp.effectMeta = await (await fetch(`./${dspName}_effect.json`)).json();
34
- faustDsp.effectModule = await WebAssembly.compileStreaming(await fetch(`./${dspName}_effect.wasm`));
35
- } catch (e) { }
36
-
37
30
  /** @type {FaustAudioWorkletNode} */
38
31
  let faustNode;
39
32
 
40
33
  // Create either a polyphonic or monophonic Faust audio node based on the number of voices
41
34
  if (voices > 0) {
35
+
36
+ // Try to load optional mixer and effect modules
37
+ try {
38
+ faustDsp.mixerModule = await WebAssembly.compileStreaming(await fetch("./mixerModule.wasm"));
39
+ faustDsp.effectMeta = await (await fetch(`./${dspName}_effect.json`)).json();
40
+ faustDsp.effectModule = await WebAssembly.compileStreaming(await fetch(`./${dspName}_effect.wasm`));
41
+ } catch (e) { }
42
+
42
43
  const generator = new FaustPolyDspGenerator();
43
44
  faustNode = await generator.createNode(
44
45
  audioContext,