Skip to content

EZ Web Audio / AudioLoadError

Class: AudioLoadError

Defined in: errors/load-error.ts:23

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}`);
  }
}

Extends

Constructors

Constructor

new AudioLoadError(message, url): AudioLoadError

Defined in: errors/load-error.ts:30

Create a new AudioLoadError.

Parameters

message

string

Human-readable error description with actionable fix

url

string

The URL that failed to load

Returns

AudioLoadError

Overrides

AudioError.constructor

Properties

code?

readonly optional code: string

Defined in: errors/audio-error.ts:30

Optional error code for programmatic handling

Inherited from

AudioError.code


url

readonly url: string

Defined in: errors/load-error.ts:32

The URL that failed to load