@grame/faustwasm 0.3.2 → 0.4.1

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.
Files changed (36) hide show
  1. package/README.md +10 -4
  2. package/assets/standalone/faust-ui/index.js +177 -247
  3. package/assets/standalone/faust-ui/index.js.map +1 -1
  4. package/assets/standalone/faustwasm/index.d.ts +6 -0
  5. package/assets/standalone/faustwasm/index.js +12 -4
  6. package/assets/standalone/faustwasm/index.js.map +2 -2
  7. package/assets/standalone/icon.png +0 -0
  8. package/assets/standalone/index-poly.js +11 -0
  9. package/assets/standalone/index.html +4 -2
  10. package/assets/standalone/index.js +11 -0
  11. package/assets/standalone/manifest.json +18 -0
  12. package/assets/standalone/service-worker.js +48 -0
  13. package/dist/cjs/index.d.ts +6 -0
  14. package/dist/cjs/index.js +12 -4
  15. package/dist/cjs/index.js.map +2 -2
  16. package/dist/cjs-bundle/index.d.ts +6 -0
  17. package/dist/cjs-bundle/index.js +12 -4
  18. package/dist/cjs-bundle/index.js.map +2 -2
  19. package/dist/esm/index.d.ts +6 -0
  20. package/dist/esm/index.js +12 -4
  21. package/dist/esm/index.js.map +2 -2
  22. package/dist/esm-bundle/index.d.ts +6 -0
  23. package/dist/esm-bundle/index.js +12 -4
  24. package/dist/esm-bundle/index.js.map +2 -2
  25. package/package.json +2 -2
  26. package/src/FaustAudioWorkletNode.ts +0 -3
  27. package/src/SoundfileReader.ts +16 -2
  28. package/src/copyWebStandaloneAssets.js +11 -1
  29. package/test/faustlive-wasm/faust-ui/index.js +177 -247
  30. package/test/faustlive-wasm/faust-ui/index.js.map +1 -1
  31. package/test/faustlive-wasm/faustwasm/index.d.ts +6 -0
  32. package/test/faustlive-wasm/faustwasm/index.js +12 -4
  33. package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
  34. package/test/osc2.dsp +1 -1
  35. package/0001-Invert-x-y-z-accelerometer-on-Android.patch +0 -194
  36. package/build +0 -17
@@ -1211,6 +1211,12 @@ export declare class WavDecoder {
1211
1211
  /** Read metadata and fetch soundfiles */
1212
1212
  export declare class SoundfileReader {
1213
1213
  static get fallbackPaths(): string[];
1214
+ /**
1215
+ * Extract the parent URL from an URL.
1216
+ * @param url : the URL
1217
+ * @returns : the parent URL
1218
+ */
1219
+ private static getParentUrl;
1214
1220
  /**
1215
1221
  * Convert an audio buffer to audio data.
1216
1222
  *
@@ -3496,8 +3496,17 @@ var WavDecoder_default = WavDecoder;
3496
3496
 
3497
3497
  // src/SoundfileReader.ts
3498
3498
  var SoundfileReader = class {
3499
+ // Set the fallback paths
3499
3500
  static get fallbackPaths() {
3500
- return [location.href, location.origin];
3501
+ return [location.href, this.getParentUrl(location.href), location.origin];
3502
+ }
3503
+ /**
3504
+ * Extract the parent URL from an URL.
3505
+ * @param url : the URL
3506
+ * @returns : the parent URL
3507
+ */
3508
+ static getParentUrl(url) {
3509
+ return url.substring(0, url.lastIndexOf("/") + 1);
3501
3510
  }
3502
3511
  /**
3503
3512
  * Convert an audio buffer to audio data.
@@ -3538,7 +3547,8 @@ var SoundfileReader = class {
3538
3547
  static async checkFileExists(url) {
3539
3548
  try {
3540
3549
  console.log(`"checkFileExists" url: ${url}`);
3541
- const response = await fetch(url, { method: "HEAD" });
3550
+ const response = await fetch(url);
3551
+ console.log(`"checkFileExists" response.ok: ${response.ok}`);
3542
3552
  return response.ok;
3543
3553
  } catch (error) {
3544
3554
  console.error("Fetch error:", error);
@@ -3659,8 +3669,6 @@ var FaustAudioWorkletNode = class extends (globalThis.AudioWorkletNode || null)
3659
3669
  async listenSensors() {
3660
3670
  if (this.hasAccInput) {
3661
3671
  const isAndroid = /Android/i.test(navigator.userAgent);
3662
- console.log(navigator.userAgent);
3663
- console.log(isAndroid);
3664
3672
  let handleDeviceMotion = null;
3665
3673
  if (isAndroid) {
3666
3674
  handleDeviceMotion = ({ accelerationIncludingGravity }) => {