ez-web-audio
Version:
Making the Web Audio API super EZ since 2024.
32 lines • 804 B
TypeScript
import { AudioError } from './audio-error';
/**
* Error thrown when audio loading fails.
*
* Common causes:
* - Invalid URL (404, network error)
* - CORS headers missing or misconfigured
* - Unsupported audio format
* - Audio decoding failure
*
* @example
* ```typescript
* try {
* await loadAudio(url);
* } catch (e) {
* if (e instanceof AudioLoadError) {
* console.error(`Failed to load: ${e.url}`);
* }
* }
* ```
*/
export declare class AudioLoadError extends AudioError {
readonly url: string;
/**
* Create a new AudioLoadError.
*
* @param message - Human-readable error description with actionable fix
* @param url - The URL that failed to load
*/
constructor(message: string, url: string);
}
//# sourceMappingURL=load-error.d.ts.map