mix
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
mix
<!-- 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/v2emberline.audio.mix — the mix, and the wiring that makes the fight audible. This is the slice's entry point. `require("emberline.audio.mix")` registers `Bus.services.sfx`, `.music` and `.voice`, fills `Bus.registry.clips`, and subscribes to every `fight.*` / `game.phase` event, so a fight makes sound whether or not the combat slice ever calls a sound service by hand. The mix, in one paragraph, because "everything at full volume" is the same as silence: the ANNOUNCER sits on top and ducks everything under him. HITS sit below the announcer and above the music, and vary in pitch so a combo is not one sample five times. MUSIC sits under everything and ducks again on a super. AMBIENCE sits under the music and never asks for attention. Emitters live under the scene's `AudioRoot` anchor, are created on demand, and are idempotent by name — a hot reload re-uses them instead of stacking a second set. The scene's `FightCamera` carries the `AudioListener`; every source here is non-spatial, because the camera is fixed and a 2D fighter wants its hits at full strength wherever they land.
anchor( ) → any
emitter(name: string, fields: { [string]: any }) → any
Emitters are looked up by NAME every time rather than cached as component proxies. Holding a live component in module state drags the whole component environment into the hot-reload rebinder, which blows its rebind budget and leaves the module half-rebound; a name lookup costs nothing by comparison.
| arg | type | description |
|---|---|---|
| name | string | |
| fields | { [string]: any } |
musicA( ) → any
musicB( ) → any
ambient( ) → any
announcer( ) → any
chorus( ) → any
fxbus( ) → any
uibus( ) → any
resolveClips( ) → any
ids: a bare sfx id ("hit_heavy"), "music.<bed>", or "voice.<speaker>.<line>".
applyMusicGain( ) → void
ramp(seconds: number, step: (number) → void
A bounded coroutine: it captures the boot generation and stops the moment a reload bumps it, so a hot reload never leaves a fade running behind the new one.
| arg | type | description |
|---|---|---|
| seconds | number | |
| step | (number |
cancelRamps( ) → void
Cancel every ramp still in flight. Called by teardown and by a hot reload, so a fade from the previous load never fights the new one.
bedFor(id: string?) → void
| arg | type | description |
|---|---|---|
| id | string? |
play(trackId: string, opts: any?) → void
| arg | type | description |
|---|---|---|
| trackId | string | |
| opts | any? |
stop(fade: number?) → void
| arg | type | description |
|---|---|---|
| fade | number? |
duck(amount: number, frames: number?) → void
amount is the multiplier the music drops TO (0.42 = a little under half).
| arg | type | description |
|---|---|---|
| amount | number | |
| frames | number? |
ambience(stageId: string?) → void
| arg | type | description |
|---|---|---|
| stageId | string? |
setStage(stageId: string) → void
The one call the fight makes when a stage loads: bed and ambience together.
| arg | type | description |
|---|---|---|
| stageId | string |
play(id: string, opts: any?) → boolean
| arg | type | description |
|---|---|---|
| id | string | |
| opts | any? |
stopAll( ) → void
ui(which: string) → void
The UI slice's own front door, so a menu never has to know a clip id.
| arg | type | description |
|---|---|---|
| which | string |
speak(em: any, key: string, level: number, oneShot: boolean) → string
| arg | type | description |
|---|---|---|
| em | any | |
| key | string | |
| level | number | |
| oneShot | boolean |
announce(lineId: string) → string
The announcer has a channel to himself: a new call replaces the last one rather than stacking, which is what an announcer actually does.
| arg | type | description |
|---|---|---|
| lineId | string |
fighter(fighterId: string, lineId: string) → string
| arg | type | description |
|---|---|---|
| fighterId | string | |
| lineId | string |
text(key: string) → string
| arg | type | description |
|---|---|---|
| key | string |
stop( ) → void
hitClip(p: any) → string
| arg | type | description |
|---|---|---|
| p | any |
wire( ) → void
boot( ) → any
buildContent(only: string?) → any
Renders and stores anything that is not on disk yet. Idempotent: a clip that exists is left exactly as it is, so this is safe to call from a boot, a hot reload or by hand. `only` narrows it to "sfx" or "music" when a pass is long.
| arg | type | description |
|---|---|---|
| only | string? |
teardown( ) → 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.
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.