@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
@@ -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
  *
@@ -9543,8 +9543,17 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
9543
9543
 
9544
9544
  // src/SoundfileReader.ts
9545
9545
  var SoundfileReader = class {
9546
+ // Set the fallback paths
9546
9547
  static get fallbackPaths() {
9547
- return [location.href, location.origin];
9548
+ return [location.href, this.getParentUrl(location.href), location.origin];
9549
+ }
9550
+ /**
9551
+ * Extract the parent URL from an URL.
9552
+ * @param url : the URL
9553
+ * @returns : the parent URL
9554
+ */
9555
+ static getParentUrl(url) {
9556
+ return url.substring(0, url.lastIndexOf("/") + 1);
9548
9557
  }
9549
9558
  /**
9550
9559
  * Convert an audio buffer to audio data.
@@ -9585,7 +9594,8 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
9585
9594
  static async checkFileExists(url) {
9586
9595
  try {
9587
9596
  console.log(`"checkFileExists" url: ${url}`);
9588
- const response = await fetch(url, { method: "HEAD" });
9597
+ const response = await fetch(url);
9598
+ console.log(`"checkFileExists" response.ok: ${response.ok}`);
9589
9599
  return response.ok;
9590
9600
  } catch (error) {
9591
9601
  console.error("Fetch error:", error);
@@ -9706,8 +9716,6 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
9706
9716
  async listenSensors() {
9707
9717
  if (this.hasAccInput) {
9708
9718
  const isAndroid = /Android/i.test(navigator.userAgent);
9709
- console.log(navigator.userAgent);
9710
- console.log(isAndroid);
9711
9719
  let handleDeviceMotion = null;
9712
9720
  if (isAndroid) {
9713
9721
  handleDeviceMotion = ({ accelerationIncludingGravity }) => {