Skip to content

EZ Web Audio / preload

Function: preload()

preload(urls, signal?): Promise<void>

Defined in: packages/core/src/preload.ts:64

Preload audio URLs into cache for faster Sound/Track creation.

Parameters

urls

Single URL or array of URLs to preload

string | string[]

signal?

AbortSignal

Optional AbortSignal to cancel in-flight fetches

Returns

Promise<void>

Promise that resolves when all URLs are cached

Throws

If any URL fails to load (after attempting all). instanceof AudioError still matches; .errors carries the per-URL AudioLoadError failures for callers that need to know which URLs failed and why.