Log inGet started
World

Science-Based 100% Dragon MMO

Branchmain
Branchesmain
Commit4c69d78227

README.md

dragon.audio

Procedural sound synthesis for the dragon. Every cue is generated in Luau and baked as a .soundClip asset holding lossless PCM (codec = "pcm" in the clip's ZAUD payload), so loops stay sample-exact.

Usage

local Audio = require("dragon.audio")

Audio.ensure()               -- bake every missing cue; idempotent
local clip = Audio.clip("wingbeat")
entity(id).component.add("Audio", { clip = clip, pitch = flapForce })

Cues

namekindratenote
wingbeatone-shot22050leathery flap; pitch with flap force
windloop22050rushing air; volume/pitch with airspeed
buffetloop2205022 Hz stall rumble
thermalloop22050Shepard–Risset endless rise
hissloop22050gas leak + wet gurgle
clickone-shot44100igniter tick
whoomphone-shot22050gas ignition blast
heartbeatloop22050lub-dub; pitch with heart rate
roarone-shot22050formant-filtered harmonic bellow
bellowone-shot22050aurochs lowing call

Loops (spec.loop on Audio.CLIPS) are seam-validated at bake: the wrap step must not exceed any interior sample step. Set looping = true on the Audio component when playing them.

API

  • Audio.ensure() -> { created, skipped, stats } — synthesize + bake every missing cue; safe to call repeatedly.
  • Audio.clip(name) -> AssetRef? — resolve a cue's soundClip.
  • Audio.exists(name) -> boolean
  • Audio.names() -> { string }
  • Audio.CLIPS : { ClipSpec } — name / loop / sampleRate per cue.