Log inGet started
World

EMBERLINE

Branchmain
Branchesmain
Commite3b1d97d67

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

ModuleWhat it is
emberline.audio.synthThe 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.sfx44 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.bedsSix music beds — title, select, and one per stage — as note lists over a fixed beat count.
emberline.audio.linesThe 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.voiceBuys each line once from audio_gen.speech and caches it as a .soundClip.
emberline.audio.bankHow a rendered sound becomes an asset: PCM for anything that loops, Opus for one-shots, settings at creation time.
emberline.audio.mixThe 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_light hit_medium hit_heavy hit_counter hit_super block_stand block_crouch block_chip whiff_light whiff_medium whiff_heavy throw_grab throw_land knockdown wakeup jump land land_heavy dash_f dash_b step fireball_fire fireball_hit dp_rise rush_go super_flash super_impact meter_tick meter_full round_bell ko_impact timeup_buzz crowd_cheer crowd_gasp ui_move ui_confirm ui_back ui_start ui_select_lock ui_pause amb_rain amb_market amb_furnace amb_terminus
  • Beds — title select platform lantern coaldeck endofline
  • Voice keys — announcer.<line> and <fighter>.<slot>; see emberline.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 / loopEnd are stored and never read, so every bed and ambience is authored seamless end to end and looped with the Audio component's own looping field.
  • 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 to asset.create, never patched on afterwards.