Sound
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->
Sound
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->TODO: describe this component.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Sound.component — everything FIRST LIGHT: SABAEAN MADCAPS is heard as. Mounted on `mount_sound` by the scene entrypoint. It owns four things: the BED wind on the plain, the herds below, and a two-deck drone crossfaded across MC.state.dawn so the temple's hum brightens as the sky does the BRAZIERS a spatial fire on every `brazier_fire` in the scene, so climbing past one is audible and relighting has a place the SCORE an opening cue and one for each ending, preferring the generated `score_*` and falling back to the synthesised `cue_*` beside it the MIX five channels, and the duck that takes the room away from all of them while somebody speaks It reads the bus and never writes to it. Every level is in `game.sound.mix`; this file is only the behaviour that applies them. Every source it plays lives on an entity it SPAWNED — `temporary` so it never reaches a scene save, `internal` so it never clutters a listing — parented either to this entity or to the brazier it belongs to. Nothing in the authored scene is modified, and `onDestroy` takes all of it back out, including the channel levels. Owned by the `sound` slice.
makeDeck(name: string, init: { [string]: any }) → Deck
| arg | type | description |
|---|---|---|
| name | string | |
| init | { [string]: any } |
bedDeck(name: string, key: string, volume: number, sourceType: string, channel: string) → Deck
| arg | type | description |
|---|---|---|
| name | string | |
| key | string | |
| volume | number | |
| sourceType | string | |
| channel | string |
silentDeck(name: string, channel: string, sourceType: string) → Deck
| arg | type | description |
|---|---|---|
| name | string | |
| channel | string | |
| sourceType | string |
placeBraziers( ) → void
sweepOrphans( ) → void
Every source this component plays is an entity it spawned, and the only record of them is in this chunk's locals — which a hot reload resets. If a reload ever lands without `onDestroy` having run first, the previous set would keep sounding with nothing left holding it. Sweeping the sources already standing under this entity, and under the fires, before building makes the graph what this run built rather than what every run built.
build( ) → void
teardown( ) → void
pushChannel(name: string, level: number) → void
| arg | type | description |
|---|---|---|
| name | string | |
| level | number |
applyMix( ) → void
deckFor(channel: string) → Deck
| arg | type | description |
|---|---|---|
| channel | string |
shoot(name: string, volumeScale: number?, pitchScale: number?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| volumeScale | number? | |
| pitchScale | number? |
stopCue(fadeOut: number?) → void
| arg | type | description |
|---|---|---|
| fadeOut | number? |
playCue(which: string) → void
| arg | type | description |
|---|---|---|
| which | string |
onSfx(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
onSay(line: any) → void
| arg | type | description |
|---|---|---|
| line | any |
onPhase(new: string, _old: string?) → void
| arg | type | description |
|---|---|---|
| new | string | |
| _old | string? |
onTierReached(tier: number) → void
| arg | type | description |
|---|---|---|
| tier | number |
onLanded(fallHeight: number?) → void
| arg | type | description |
|---|---|---|
| fallHeight | number? |
onShoved(_rivalId: string?) → void
| arg | type | description |
|---|---|---|
| _rivalId | string? |
on(name: string, fn: (...any) → void
| arg | type | description |
|---|---|---|
| name | string | |
| fn | (...any |
awake( ) → void
onDestroy( ) → void
drive(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
editorUpdate(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
shot(name: string) → boolean
Fire one named one-shot from the mix table — the same path the `sfx` signal takes. Returns whether a clip was found for that name.
| arg | type | description |
|---|---|---|
| name | string |
cue(which: string) → boolean
Start one score cue by phase name ("opening" | "won" | "lost").
| arg | type | description |
|---|---|---|
| which | string |
previewDawn(d: number) → number
Hold the drone crossfade at one point in the dawn, whatever the race clock says — 0 is the deep pre-dawn deck, 1 the open one. Any negative value hands it back to MC.state.dawn. The crossfade still ramps into the value rather than jumping to it, so what is heard is what a run would hear passing through that hour.
| arg | type | description |
|---|---|---|
| d | number |
duckFor(seconds: number) → void
Duck the mix under a spoken line of this many seconds, without a clip.
| arg | type | description |
|---|---|---|
| seconds | number |
state( ) → any
Everything the mix is doing right now: the channels as they were pushed at the mixer, how far the duck is in, the dawn crossfade, the cue that is up, and every deck with the level it is playing at.
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
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.