audio
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
audio
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.audio.audio — everything the game sounds like. Plays the baked bank in `game.audio.clips` at the moment each thing happens, from the position it happens at. It subscribes to the same events the rest of the game publishes — SHOT, IMPACT, RELOAD_START, WEAPON_SWITCH — so a gunshot is one event that produces recoil, a flash, a casing and a sound, rather than four systems each deciding independently that a shot occurred. VOICES ARE POOLED. A weapon at 900 rounds a minute is fifteen shots a second, and an entity per shot would create and destroy thousands across a match along with the cost of both. A fixed set of voices is created once and lent out; a voice that is still sounding when its turn comes round again is taken back, because under sustained fire a stolen tail is less noticeable than a dropped shot. The reload is the case worth reading closely. Its sounds are not fired at the start: the component holds the reload stage it last sounded and emits each mechanical noise as the stage passes it, so the click of the magazine catch lands with the hand movement and the seat lands with the ammunition changing. That is why the sound comes off `Core.State.reloadStage` rather than off the RELOAD_START event alone. Footsteps are driven by measured speed rather than by a timer: a step lands once the player has actually covered ground, so walking, sprinting and crouching differ without anything being told which one it is.
clip(key: ?) → void
| arg | type | description |
|---|---|---|
| key | ? |
shotKey(weaponId: ?) → void
The key a weapon's shot uses.
| arg | type | description |
|---|---|---|
| weaponId | ? |
build(parent: ?) → void
Voices
| arg | type | description |
|---|---|---|
| parent | ? |
clear( ) → void
takeVoice( ) → void
play(key: ?, pos: ?, volume: ?, pitch: ?) → void
Play one sound. `pos` is where it happens in the world; a positional source is what makes a shot from across the street arrive from across the street.
| arg | type | description |
|---|---|---|
| key | ? | |
| pos | ? | |
| volume | ? | |
| pitch | ? |
onShot(shot: ?) → void
| arg | type | description |
|---|---|---|
| shot | ? |
surfaceKey(entityId: ?) → void
Which of the district's materials a struck surface wears.
| arg | type | description |
|---|---|---|
| entityId | ? |
onImpact(impact: ?) → void
| arg | type | description |
|---|---|---|
| impact | ? |
onReloadStart( ) → void
onSwitch( ) → void
soundReload(dt: ?) → void
Per frame The reload's mechanical noises, emitted as their stages pass.
| arg | type | description |
|---|---|---|
| dt | ? |
soundSteps(dt: ?) → void
A footfall, driven by ground covered rather than by a timer, so walking, sprinting and crouching each get their own rhythm without being told which they are.
| arg | type | description |
|---|---|---|
| dt | ? |
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
subscribe( ) → void
unsubscribe( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.