@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.
@@ -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
  *
@@ -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, { method: "HEAD" });
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 }) => {