
This page covers loading content, audio playback, simple save persistence, and the runtime file API.
Core loading surface:
load(path)exists(path)loadJson(path)loadText(path)loadFont(path)loadBitmapFont(path)getFormatSupport(path)Streaming/cache helpers:
getState(path)getStateHistory(path)evict(path)getCachePolicy()setCachePolicy(policy)preload2d(paths)preload3d(paths)Use cases:
Notes:
load* family above.load, loadJson, loadText, and the preload/cache methods listed here.Core playback and global control:
play(...)stop(handle)pause(handle)resume(handle)getState(handle)setVolume(handle, volume)setMasterVolume(volume)pauseAll()resumeAll()stopAll()Spatial audio and listener/emitter helpers:
setHRTF(enabled)setListener(options)playSpatial(pathOrSpec, options)setEmitterPosition(handle, position)setOcclusion(handle, value)addReverbZone(zone)removeReverbZone(zoneId)clearReverbZones()Mixer/bus/envelope helpers:
setBusVolume(bus, volume)assignBus(handle, bus)fadeTrack(handle, options)fadeBus(bus, options)crossfade(fromHandle, toHandle, options)update(dt)clearEnvelopes()getMixerState()Use cases:
Truth boundary:
getState(handle) returns null for unknown or inactive handlesresumeAll() only resumes handles paused by pauseAll(), not handles
gameplay paused explicitly earliernull because that runtime path does not own sample
positionGenerated 2D projects can also use src/starter-utils/scene-audio-2d.js when
you want one explicit scene-level ownership lane on top of aura.audio.
The helper owns a deliberately small contract:
createSceneAudio2D(aura, options?)ensureSceneMusic2D(sceneAudio, path, options?)playSceneStinger2D(sceneAudio, path, options?)pauseSceneAudio2D(sceneAudio, options?)resumeSceneAudio2D(sceneAudio, options?)syncSceneAudio2D(sceneAudio, dt, options?)stopSceneAudio2D(sceneAudio, options?)Truth boundary:
aura.audio mixer/bus surfaceassets/title-loop.wavaura.assets.exists(path) firstPersistence surface:
save(key, value)load(key, fallback?)delete(key)keys()Legacy aliases:
set(key, value)get(key, fallback?)Use cases:
For larger authored 2D worlds, the scaffolded helper lane now includes
world-persistence-2d.js for explicit streamed-world snapshot and rehydrate
ownership over aura.storage.
Keep that boundary honest:
Runtime-safe file helpers:
exists(path)readText(path)writeText(path, value)readJson(path)writeJson(path, value)mkdir(path)list(path)remove(path)Important notes:
.. traversal are rejectedFor richer save/export/apply flows, see 07 Scenes, State, Debug, and Test Harness and the auramaxx state CLI docs.