import type { Sound } from "./core.ts"; /** * Fetches the bytes for an audio URL. * * Defaults to the engine's shared transport, which falls back to XHR for `file:` * URLs — `fetch()` cannot read that scheme in a Cordova or Capacitor WebView. * {@link setAudioFetcher} overrides it, for a custom transport or a test. * * The default is a working implementation rather than a stub that must be * installed, because a rejection here is not reported as an error: it tells the * backend to abandon Web Audio for that clip and fall back to a streaming HTML5 * element. An un-installed stub would therefore degrade every network clip * silently instead of failing loudly. */ export type AudioFetcher = (url: string, options: { withCredentials?: boolean | undefined; }) => Promise; /** * Install the function the backend uses to fetch audio bytes. * @param fetcher - obtains the bytes for a URL, rejecting on failure */ export declare const setAudioFetcher: (fetcher: AudioFetcher) => void; export declare const loadBuffer: (self: Sound) => void; export declare const decodeAudioData: (arraybuffer: ArrayBuffer, self: Sound) => void; export declare const loadSound: (self: Sound, buffer?: AudioBuffer) => void; //# sourceMappingURL=buffer.d.ts.map