@grame/faustwasm 0.13.0 → 0.13.2
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/README.md +2 -2
- package/assets/standalone/faustwasm/index.js +33 -14
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.js +33 -14
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.js +33 -14
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.js +33 -14
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.js +33 -14
- package/dist/esm-bundle/index.js.map +2 -2
- package/package.json +1 -1
- package/src/FaustDspGenerator.ts +47 -26
- package/test/faustlive-wasm/faustwasm/index.js +33 -14
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
- package/test/web/create-faust-node.js +4 -9
package/dist/cjs-bundle/index.js
CHANGED
|
@@ -11026,6 +11026,7 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
|
|
|
11026
11026
|
};
|
|
11027
11027
|
|
|
11028
11028
|
// src/FaustDspGenerator.ts
|
|
11029
|
+
var import_meta = {};
|
|
11029
11030
|
var _FaustMonoDspGenerator = class _FaustMonoDspGenerator {
|
|
11030
11031
|
constructor() {
|
|
11031
11032
|
this.factory = null;
|
|
@@ -11674,20 +11675,38 @@ const dependencies = {
|
|
|
11674
11675
|
async createFaustNode(context, name, code, sp, bufferSize) {
|
|
11675
11676
|
const getCompiler = async () => {
|
|
11676
11677
|
if (!_FaustDspGenerator.compilerPromise) {
|
|
11677
|
-
const
|
|
11678
|
-
if (
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
jsURL
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11678
|
+
const isNode = typeof document === "undefined" && typeof window === "undefined";
|
|
11679
|
+
if (isNode) {
|
|
11680
|
+
const baseURL = (typeof __dirname !== "undefined" ? `file://${__dirname}/` : void 0) || (typeof import_meta !== "undefined" && typeof import_meta.url === "string" ? import_meta.url : void 0);
|
|
11681
|
+
if (!baseURL)
|
|
11682
|
+
throw new Error("Cannot resolve libfaust-wasm location.");
|
|
11683
|
+
const jsURL = new URL(
|
|
11684
|
+
"../libfaust-wasm/libfaust-wasm.js",
|
|
11685
|
+
baseURL
|
|
11686
|
+
).href;
|
|
11687
|
+
const dataURL = jsURL.replace(/c?js$/, "data");
|
|
11688
|
+
const wasmURL = jsURL.replace(/c?js$/, "wasm");
|
|
11689
|
+
_FaustDspGenerator.compilerPromise = instantiateFaustModuleFromFile_default(
|
|
11690
|
+
jsURL,
|
|
11691
|
+
dataURL,
|
|
11692
|
+
wasmURL
|
|
11693
|
+
).then((module) => new FaustCompiler_default(new LibFaust_default(module)));
|
|
11694
|
+
} else {
|
|
11695
|
+
const baseURL = (typeof document !== "undefined" ? "src" in (document.currentScript || {}) ? document.currentScript.src : document.baseURI : void 0) || (typeof window !== "undefined" ? window.location.href : void 0);
|
|
11696
|
+
if (!baseURL)
|
|
11697
|
+
throw new Error("Cannot resolve libfaust-wasm location.");
|
|
11698
|
+
const jsURL = new URL(
|
|
11699
|
+
"../libfaust-wasm/libfaust-wasm.js",
|
|
11700
|
+
baseURL
|
|
11701
|
+
).href;
|
|
11702
|
+
const dataURL = jsURL.replace(/c?js$/, "data");
|
|
11703
|
+
const wasmURL = jsURL.replace(/c?js$/, "wasm");
|
|
11704
|
+
_FaustDspGenerator.compilerPromise = instantiateFaustModuleFromFile_default(
|
|
11705
|
+
jsURL,
|
|
11706
|
+
dataURL,
|
|
11707
|
+
wasmURL
|
|
11708
|
+
).then((module) => new FaustCompiler_default(new LibFaust_default(module)));
|
|
11709
|
+
}
|
|
11691
11710
|
}
|
|
11692
11711
|
return _FaustDspGenerator.compilerPromise;
|
|
11693
11712
|
};
|