@grame/faustwasm 0.15.6 → 0.15.7
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/assets/standalone/faustwasm/index.d.ts +0 -7
- package/assets/standalone/faustwasm/index.js +17 -31
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.d.ts +0 -7
- package/dist/cjs/index.js +17 -31
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.d.ts +0 -7
- package/dist/cjs-bundle/index.js +17 -31
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.d.ts +0 -7
- package/dist/esm/index.js +17 -31
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.d.ts +0 -7
- package/dist/esm-bundle/index.js +17 -31
- package/dist/esm-bundle/index.js.map +2 -2
- package/package.json +1 -1
- package/src/FaustOfflineProcessor.ts +1 -1
- package/src/FaustWebAudioDsp.ts +3 -1
- package/src/SoundfileReader.ts +17 -32
- package/src/faust2wavFiles.js +6 -1
- package/test/faustlive-wasm/faustwasm/index.d.ts +0 -7
- package/test/faustlive-wasm/faustwasm/index.js +17 -31
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
package/dist/esm/index.d.ts
CHANGED
|
@@ -1378,13 +1378,6 @@ export declare class SoundfileReader {
|
|
|
1378
1378
|
* @returns : the URLs
|
|
1379
1379
|
*/
|
|
1380
1380
|
static findSoundfilesFromMeta(dspMeta: FaustDspMeta): LooseFaustDspFactory["soundfiles"];
|
|
1381
|
-
/**
|
|
1382
|
-
* Check if the file exists.
|
|
1383
|
-
*
|
|
1384
|
-
* @param url : the url of the file to check
|
|
1385
|
-
* @returns : true if the file exists, otherwise false
|
|
1386
|
-
*/
|
|
1387
|
-
private static checkFileExists;
|
|
1388
1381
|
/**
|
|
1389
1382
|
* Fetch the soundfile.
|
|
1390
1383
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -2712,7 +2712,7 @@ var FaustBaseWebAudioDsp = class _FaustBaseWebAudioDsp {
|
|
|
2712
2712
|
const trimmed = input.replace(/^\{|\}$/g, "");
|
|
2713
2713
|
return trimmed.split(";").map(
|
|
2714
2714
|
(str) => str.length <= 2 ? "" : str.substring(1, str.length - 1)
|
|
2715
|
-
);
|
|
2715
|
+
).map((str) => str.trim()).filter((str) => str.length > 0);
|
|
2716
2716
|
}
|
|
2717
2717
|
get hasAccInput() {
|
|
2718
2718
|
return this.fAcc.x.length + this.fAcc.y.length + this.fAcc.z.length > 0;
|
|
@@ -3973,7 +3973,7 @@ var FaustOfflineProcessor = class {
|
|
|
3973
3973
|
outputs[i].set(output, l);
|
|
3974
3974
|
}
|
|
3975
3975
|
}
|
|
3976
|
-
l +=
|
|
3976
|
+
l += sliceLength;
|
|
3977
3977
|
onUpdate == null ? void 0 : onUpdate(l);
|
|
3978
3978
|
}
|
|
3979
3979
|
this.fDSPCode.stop();
|
|
@@ -4522,29 +4522,12 @@ var SoundfileReader = class {
|
|
|
4522
4522
|
const callback = (item) => {
|
|
4523
4523
|
if (item.type === "soundfile") {
|
|
4524
4524
|
const urls = FaustBaseWebAudioDsp.splitSoundfileNames(item.url);
|
|
4525
|
-
urls.forEach((url) => soundfiles[url] = null);
|
|
4525
|
+
urls.filter((url) => url.trim().length > 0).forEach((url) => soundfiles[url] = null);
|
|
4526
4526
|
}
|
|
4527
4527
|
};
|
|
4528
4528
|
FaustBaseWebAudioDsp.parseUI(dspMeta.ui, callback);
|
|
4529
4529
|
return soundfiles;
|
|
4530
4530
|
}
|
|
4531
|
-
/**
|
|
4532
|
-
* Check if the file exists.
|
|
4533
|
-
*
|
|
4534
|
-
* @param url : the url of the file to check
|
|
4535
|
-
* @returns : true if the file exists, otherwise false
|
|
4536
|
-
*/
|
|
4537
|
-
static async checkFileExists(url) {
|
|
4538
|
-
try {
|
|
4539
|
-
console.log(`"checkFileExists" url: ${url}`);
|
|
4540
|
-
const response = await fetch(url);
|
|
4541
|
-
console.log(`"checkFileExists" response.ok: ${response.ok}`);
|
|
4542
|
-
return response.ok;
|
|
4543
|
-
} catch (error) {
|
|
4544
|
-
console.error("Fetch error:", error);
|
|
4545
|
-
return false;
|
|
4546
|
-
}
|
|
4547
|
-
}
|
|
4548
4531
|
/**
|
|
4549
4532
|
* Fetch the soundfile.
|
|
4550
4533
|
*
|
|
@@ -4579,17 +4562,20 @@ var SoundfileReader = class {
|
|
|
4579
4562
|
(path) => new URL(filename, path.endsWith("/") ? path : `${path}/`).href
|
|
4580
4563
|
)
|
|
4581
4564
|
];
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4565
|
+
let lastError = null;
|
|
4566
|
+
for (const url of urlsToCheck) {
|
|
4567
|
+
try {
|
|
4568
|
+
soundfiles[filename] = await this.fetchSoundfile(
|
|
4569
|
+
url,
|
|
4570
|
+
audioCtx
|
|
4571
|
+
);
|
|
4572
|
+
return;
|
|
4573
|
+
} catch (error) {
|
|
4574
|
+
lastError = error;
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4577
|
+
throw new Error(
|
|
4578
|
+
`Failed to load sound file ${filename}, all check failed. Last error: ${String(lastError)}`
|
|
4593
4579
|
);
|
|
4594
4580
|
}
|
|
4595
4581
|
/**
|