star-audio 0.1.1 → 0.1.2

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/dist/index.js CHANGED
@@ -2799,6 +2799,11 @@ var StarAudioImpl = class {
2799
2799
  this.music.fadeTo = this.music.crossfadeTo;
2800
2800
  this.music.switchTo = this.music.crossfadeTo;
2801
2801
  this.musicFadeTo = this.music.crossfadeTo;
2802
+ for (const presetName of Object.keys(PRESET_DEFINITIONS)) {
2803
+ this._loadProceduralSound(presetName, presetName).catch((err) => {
2804
+ console.warn(`[StarAudio] Failed to auto-preload preset ${presetName}:`, err);
2805
+ });
2806
+ }
2802
2807
  }
2803
2808
  get state() {
2804
2809
  return this._state;
@@ -2903,11 +2908,9 @@ var StarAudioImpl = class {
2903
2908
  // --- Playback ---
2904
2909
  play(id, opts = {}) {
2905
2910
  if (isPreset(id) && !this._sounds.has(id)) {
2906
- console.info(`[StarAudio] Auto-generating preset: ${id}`);
2907
2911
  this._loadProceduralSound(id, id).catch((err) => {
2908
2912
  console.error(`[StarAudio] Failed to generate preset ${id}:`, err);
2909
2913
  });
2910
- console.warn(`[StarAudio] Preset ${id} is generating, try again in a moment`);
2911
2914
  return null;
2912
2915
  }
2913
2916
  if ((opts.src || opts.url) && !this._sounds.has(id)) {