@grame/faustwasm 0.13.2 → 0.13.4

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.
package/dist/cjs/index.js CHANGED
@@ -5221,7 +5221,6 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
5221
5221
  };
5222
5222
 
5223
5223
  // src/FaustDspGenerator.ts
5224
- var import_meta = {};
5225
5224
  var _FaustMonoDspGenerator = class _FaustMonoDspGenerator {
5226
5225
  constructor() {
5227
5226
  this.factory = null;
@@ -5578,7 +5577,10 @@ process = adaptorIns(dsp_code.process) : dsp_code.effect : adaptorOuts;
5578
5577
  }
5579
5578
  }
5580
5579
  } catch (e) {
5581
- console.warn(e);
5580
+ const errorMessage = e instanceof Error ? e.message : String(e != null ? e : "unknown error");
5581
+ if (!errorMessage.includes("undefined symbol : effect")) {
5582
+ console.warn(e);
5583
+ }
5582
5584
  this.voiceFactory = await compiler.createPolyDSPFactory(
5583
5585
  name,
5584
5586
  dspCodeAux,
@@ -5870,38 +5872,20 @@ const dependencies = {
5870
5872
  async createFaustNode(context, name, code, sp, bufferSize) {
5871
5873
  const getCompiler = async () => {
5872
5874
  if (!_FaustDspGenerator.compilerPromise) {
5873
- const isNode = typeof document === "undefined" && typeof window === "undefined";
5874
- if (isNode) {
5875
- const baseURL = (typeof __dirname !== "undefined" ? `file://${__dirname}/` : void 0) || (typeof import_meta !== "undefined" && typeof import_meta.url === "string" ? import_meta.url : void 0);
5876
- if (!baseURL)
5877
- throw new Error("Cannot resolve libfaust-wasm location.");
5878
- const jsURL = new URL(
5879
- "../libfaust-wasm/libfaust-wasm.js",
5880
- baseURL
5881
- ).href;
5882
- const dataURL = jsURL.replace(/c?js$/, "data");
5883
- const wasmURL = jsURL.replace(/c?js$/, "wasm");
5884
- _FaustDspGenerator.compilerPromise = instantiateFaustModuleFromFile_default(
5885
- jsURL,
5886
- dataURL,
5887
- wasmURL
5888
- ).then((module) => new FaustCompiler_default(new LibFaust_default(module)));
5889
- } else {
5890
- const baseURL = (typeof document !== "undefined" ? "src" in (document.currentScript || {}) ? document.currentScript.src : document.baseURI : void 0) || (typeof window !== "undefined" ? window.location.href : void 0);
5891
- if (!baseURL)
5892
- throw new Error("Cannot resolve libfaust-wasm location.");
5893
- const jsURL = new URL(
5894
- "../libfaust-wasm/libfaust-wasm.js",
5895
- baseURL
5896
- ).href;
5897
- const dataURL = jsURL.replace(/c?js$/, "data");
5898
- const wasmURL = jsURL.replace(/c?js$/, "wasm");
5899
- _FaustDspGenerator.compilerPromise = instantiateFaustModuleFromFile_default(
5900
- jsURL,
5901
- dataURL,
5902
- wasmURL
5903
- ).then((module) => new FaustCompiler_default(new LibFaust_default(module)));
5904
- }
5875
+ const baseURL = (typeof document !== "undefined" ? "src" in (document.currentScript || {}) ? document.currentScript.src : document.baseURI : void 0) || (typeof window !== "undefined" ? window.location.href : void 0);
5876
+ if (!baseURL)
5877
+ throw new Error("Cannot resolve libfaust-wasm location.");
5878
+ const jsURL = new URL(
5879
+ "../libfaust-wasm/libfaust-wasm.js",
5880
+ baseURL
5881
+ ).href;
5882
+ const dataURL = jsURL.replace(/c?js$/, "data");
5883
+ const wasmURL = jsURL.replace(/c?js$/, "wasm");
5884
+ _FaustDspGenerator.compilerPromise = instantiateFaustModuleFromFile_default(
5885
+ jsURL,
5886
+ dataURL,
5887
+ wasmURL
5888
+ ).then((module) => new FaustCompiler_default(new LibFaust_default(module)));
5905
5889
  }
5906
5890
  return _FaustDspGenerator.compilerPromise;
5907
5891
  };