Skip to content

API Interface AudioPackage

github-actions[bot] edited this page Nov 24, 2026 · 1 revision

Interface: AudioPackage

Defined in: src/plugins/audio/runtime/media/packages.ts:64

ADR 0351 §9: a package of sounds a game loads and unloads (Audio.package(name)).

Properties

bytes

readonly bytes: number;

Defined in: src/plugins/audio/runtime/media/packages.ts:70

Its download size for this platform, bytes (0 over the sources in the editor); with language parts, the base and the current language's part.


languages

readonly languages: readonly string[];

Defined in: src/plugins/audio/runtime/media/packages.ts:74

ADR 0354 §6: the languages it has a part for (empty for a package without localised sounds, and over the sources).


memoryBytes

readonly memoryBytes: number;

Defined in: src/plugins/audio/runtime/media/packages.ts:72

What it holds in memory while loaded, bytes: decoded clips, compressed bytes, prefetch heads (the base and the current language's part).


name

readonly name: string;

Defined in: src/plugins/audio/runtime/media/packages.ts:65


progress

readonly progress: number;

Defined in: src/plugins/audio/runtime/media/packages.ts:68

0..1 while loading (1 once loaded, 0 when unloaded).


state

readonly state: "failed" | "unloaded" | "loading" | "loaded";

Defined in: src/plugins/audio/runtime/media/packages.ts:66

Methods

load()

load(): Promise<void>;

Defined in: src/plugins/audio/runtime/media/packages.ts:76

Reference-counted: resolves once it is loaded, rejects with the reason (an unknown name, a failed fetch).

Returns

Promise<void>


unload()

unload(options?): void;

Defined in: src/plugins/audio/runtime/media/packages.ts:81

Drops one reference. The last one stops the voices of the sounds no other loaded package holds with a 50 ms fade (finish: true lets them end first) and frees them.

Parameters

options?
finish?

boolean

Returns

void

Clone this wiki locally