@grame/faustwasm 0.3.2 → 0.4.0
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 +10 -4
- package/assets/standalone/faustwasm/index.d.ts +6 -0
- package/assets/standalone/faustwasm/index.js +12 -4
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/assets/standalone/icon.png +0 -0
- package/assets/standalone/index-poly.js +11 -0
- package/assets/standalone/index.html +4 -2
- package/assets/standalone/index.js +11 -0
- package/assets/standalone/manifest.json +18 -0
- package/assets/standalone/service-worker.js +48 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.js +12 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.d.ts +6 -0
- package/dist/cjs-bundle/index.js +12 -4
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +12 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.d.ts +6 -0
- package/dist/esm-bundle/index.js +12 -4
- package/dist/esm-bundle/index.js.map +2 -2
- package/package.json +1 -1
- package/src/FaustAudioWorkletNode.ts +0 -3
- package/src/SoundfileReader.ts +16 -2
- package/src/copyWebStandaloneAssets.js +11 -1
- package/test/faustlive-wasm/faustwasm/index.d.ts +6 -0
- package/test/faustlive-wasm/faustwasm/index.js +12 -4
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
- package/test/osc2.dsp +1 -1
- package/0001-Invert-x-y-z-accelerometer-on-Android.patch +0 -194
- package/build +0 -17
|
@@ -1218,6 +1218,12 @@ export declare class WavDecoder {
|
|
|
1218
1218
|
/** Read metadata and fetch soundfiles */
|
|
1219
1219
|
export declare class SoundfileReader {
|
|
1220
1220
|
static get fallbackPaths(): string[];
|
|
1221
|
+
/**
|
|
1222
|
+
* Extract the parent URL from an URL.
|
|
1223
|
+
* @param url : the URL
|
|
1224
|
+
* @returns : the parent URL
|
|
1225
|
+
*/
|
|
1226
|
+
private static getParentUrl;
|
|
1221
1227
|
/**
|
|
1222
1228
|
* Convert an audio buffer to audio data.
|
|
1223
1229
|
*
|
package/dist/esm-bundle/index.js
CHANGED
|
@@ -9498,8 +9498,17 @@ var WavDecoder_default = WavDecoder;
|
|
|
9498
9498
|
|
|
9499
9499
|
// src/SoundfileReader.ts
|
|
9500
9500
|
var SoundfileReader = class {
|
|
9501
|
+
// Set the fallback paths
|
|
9501
9502
|
static get fallbackPaths() {
|
|
9502
|
-
return [location.href, location.origin];
|
|
9503
|
+
return [location.href, this.getParentUrl(location.href), location.origin];
|
|
9504
|
+
}
|
|
9505
|
+
/**
|
|
9506
|
+
* Extract the parent URL from an URL.
|
|
9507
|
+
* @param url : the URL
|
|
9508
|
+
* @returns : the parent URL
|
|
9509
|
+
*/
|
|
9510
|
+
static getParentUrl(url) {
|
|
9511
|
+
return url.substring(0, url.lastIndexOf("/") + 1);
|
|
9503
9512
|
}
|
|
9504
9513
|
/**
|
|
9505
9514
|
* Convert an audio buffer to audio data.
|
|
@@ -9540,7 +9549,8 @@ var SoundfileReader = class {
|
|
|
9540
9549
|
static async checkFileExists(url) {
|
|
9541
9550
|
try {
|
|
9542
9551
|
console.log(`"checkFileExists" url: ${url}`);
|
|
9543
|
-
const response = await fetch(url
|
|
9552
|
+
const response = await fetch(url);
|
|
9553
|
+
console.log(`"checkFileExists" response.ok: ${response.ok}`);
|
|
9544
9554
|
return response.ok;
|
|
9545
9555
|
} catch (error) {
|
|
9546
9556
|
console.error("Fetch error:", error);
|
|
@@ -9661,8 +9671,6 @@ var FaustAudioWorkletNode = class extends (globalThis.AudioWorkletNode || null)
|
|
|
9661
9671
|
async listenSensors() {
|
|
9662
9672
|
if (this.hasAccInput) {
|
|
9663
9673
|
const isAndroid = /Android/i.test(navigator.userAgent);
|
|
9664
|
-
console.log(navigator.userAgent);
|
|
9665
|
-
console.log(isAndroid);
|
|
9666
9674
|
let handleDeviceMotion = null;
|
|
9667
9675
|
if (isAndroid) {
|
|
9668
9676
|
handleDeviceMotion = ({ accelerationIncludingGravity }) => {
|