Abstract Class: AudioDevice
Defined in: platform/audio-device.ts:12
Stackable audio player driven by the AssetManager.
The AssetManager decides which audio data is needed within the current look-ahead window and pushes it in via append; the device caches the decoded form, schedules the matching AudioRequests via schedule, and drives playback through syncTo on each tick.
Constructors
Constructor
new AudioDevice():
AudioDevice
Returns
AudioDevice
Methods
append()
abstractappend(src,data):Promise<void>
Defined in: platform/audio-device.ts:20
Decode and stack data under src. Idempotent — repeat calls for an
already-cached src are no-ops.
Parameters
src
string
data
ArrayBuffer
Returns
Promise<void>
dispose()
dispose():
void
Defined in: platform/audio-device.ts:47
Returns
void
has()
abstracthas(src):boolean
Defined in: platform/audio-device.ts:14
True if decoded data for src is already cached on the device.
Parameters
src
string
Returns
boolean
play()
abstractplay(time,speed,reverse):void|Promise<void>
Defined in: platform/audio-device.ts:38
Parameters
time
number
speed
number
reverse
boolean
Returns
void | Promise<void>
retain()
abstractretain(keep):void
Defined in: platform/audio-device.ts:23
Drop cached audio data (and any active sources) for srcs not in keep.
Parameters
keep
ReadonlySet<string>
Returns
void
schedule()
abstractschedule(requests):void
Defined in: platform/audio-device.ts:30
Set the working set of audio requests for the current look-ahead window. Requests no longer present are stopped; new ones become eligible for playback via syncTo as soon as their data is appended.
Parameters
requests
readonly AudioRequest[]
Returns
void
setMuted()
setMuted(
_muted):void
Defined in: platform/audio-device.ts:45
Mute or unmute all output. Default is a no-op for devices that produce no sound (e.g. export/noop sinks).
Parameters
_muted
boolean
Returns
void
stop()
abstractstop():void
Defined in: platform/audio-device.ts:39
Returns
void
syncTo()
abstractsyncTo(sceneTime):void
Defined in: platform/audio-device.ts:36
Start/stop scheduled sources to match sceneTime. Called every tick.
Sources whose data has not yet been appended are skipped until it is.
Parameters
sceneTime
number
Returns
void