EMBERLINE
README.md
emberline.audio — the mix, and the voice
Everything EMBERLINE makes a noise with. One entry point:
require("emberline.audio.mix")
Requiring it registers Bus.services.sfx, Bus.services.music and
Bus.services.voice, fills Bus.registry.clips, and subscribes to every
fight.* and game.phase event. A slice that emits the documented fight
events gets sound for free — it does not have to call a sound service.
Modules
| Module | What it is |
|---|---|
emberline.audio.synth | The CPU synthesiser. Oscillators, noise, envelopes, filters, a circular echo, and a small note sequencer. Every voice writes wrapped, so anything rendered as a loop is seamless end to end. |
emberline.audio.sfx | 44 one-shots and four stage ambiences, written as DSP: hits by strength, blocks, whiffs, jumps, landings, dashes, throws, projectiles, the meter, the round bell, the crowd, and every UI move. |
emberline.audio.beds | Six music beds — title, select, and one per stage — as note lists over a fixed beat count. |
emberline.audio.lines | The written script: the announcer's whole round grammar, each fighter's eight voice slots, and the Warden's two long lines. Text first, audio second. |
emberline.audio.voice | Buys each line once from audio_gen.speech and caches it as a .soundClip. |
emberline.audio.bank | How a rendered sound becomes an asset: PCM for anything that loops, Opus for one-shots, settings at creation time. |
emberline.audio.mix | The mix, the emitters, the services, and the event wiring. |
Services
sfx play(id, opts?) stopAll() ui(which)
music play(bedId, opts?) stop(fade?) duck(amount, frames)
ambience(stageId?) setStage(stageId)
voice announce(lineId) -> text fighter(fighterId, lineId) -> text
text(key) lines
opts on sfx.play: volume, pitch, gap (minimum seconds since the same
id last played — the default 0.035 is what stops a five-hit combo from phasing),
bus = "ui".
voice.announce and voice.fighter return the written line and emit
voice.line { key, speaker, text, spoken } before any audio plays, so the
UI can put it on screen whether or not the clip exists. A line whose generation
failed is a quiet line, never a missing one.
Ids
- SFX —
hit_lighthit_mediumhit_heavyhit_counterhit_superblock_standblock_crouchblock_chipwhiff_lightwhiff_mediumwhiff_heavythrow_grabthrow_landknockdownwakeupjumplandland_heavydash_fdash_bstepfireball_firefireball_hitdp_riserush_gosuper_flashsuper_impactmeter_tickmeter_fullround_bellko_impacttimeup_buzzcrowd_cheercrowd_gaspui_moveui_confirmui_backui_startui_select_lockui_pauseamb_rainamb_marketamb_furnaceamb_terminus - Beds —
titleselectplatformlanterncoaldeckendofline - Voice keys —
announcer.<line>and<fighter>.<slot>; seeemberline.audio.lines.
Building the clip library
Clips live under /source/audio/. They are built once and then left alone:
require("emberline.audio.mix").buildContent() -- sfx + beds, idempotent
require("emberline.audio.voice").buildMissing() -- speech, 2 credits a line
require("emberline.audio.voice").audit() -- what exists, what is real
The two audio defects this slice is shaped around
- Loop points do nothing.
loopStart/loopEndare stored and never read, so every bed and ambience is authored seamless end to end and looped with theAudiocomponent's ownloopingfield. - Opus loses its first few milliseconds on decode. Anything that loops is
codec = "pcm"; one-shots stay Opus so the world stays small. Compression is passed toasset.create, never patched on afterwards.