audioBuild
World-only build tool used to make soundstage's audio. It trims, normalises and fades the generated raw clips, and turns music and beds into seamless loops (crossfading the tail into the head at the quietest point it can find). Not part of the package.
audioBuild
World-only build tool used to make soundstage's audio. It trims, normalises and fades the generated raw clips, and turns music and beds into seamless loops (crossfading the tail into the head at the quietest point it can find). Not part of the package.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Soundstage's audio mastering pass (world tool, not shipped in the package): turns raw audio_gen output in /source/rawAudio into the finished, normalised, seamlessly looping clips stored in soundstage.package. The original raws were deleted to keep the world lean, so re-making a clip starts from a fresh generation saved under that folder.
load(path: string) → Audio
| arg | type | description |
|---|---|---|
| path | string |
get(a: Audio, f: number, c: number) → number
| arg | type | description |
|---|---|---|
| a | Audio | |
| f | number | |
| c | number |
envelope(a: Audio, hop: number) → void
RMS envelope over hops of `hop` frames (mono sum)
| arg | type | description |
|---|---|---|
| a | Audio | |
| hop | number |
median(t: { number }) → number
| arg | type | description |
|---|---|---|
| t | { number } |
peakOf(a: Audio) → number
| arg | type | description |
|---|---|---|
| a | Audio |
slice(a: Audio, s: number, e: number, mono: boolean?) → Audio
copy frames [s, e) into a new Audio, optionally downmixed to mono
| arg | type | description |
|---|---|---|
| a | Audio | |
| s | number | |
| e | number | |
| mono | boolean? |
master(a: Audio, targetRms: number, ceiling: number, shortTerm: boolean?) → number
scale to a target RMS (measured over the loud body) and soft-limit peaks
| arg | type | description |
|---|---|---|
| a | Audio | |
| targetRms | number | |
| ceiling | number | |
| shortTerm | boolean? |
applyGain(a: Audio, g: number, ceiling: number) → void
multiply by g; a tanh-style soft knee above 0.8*ceiling bends a loud peak instead of clipping it
| arg | type | description |
|---|---|---|
| a | Audio | |
| g | number | |
| ceiling | number |
levelLufs(a: Audio, target: number, ceiling: number) → number
Bring a clip to an integrated loudness (BS.1770 LUFS), through the same soft knee. Two passes, since the knee takes a little loudness off the loudest peaks.
| arg | type | description |
|---|---|---|
| a | Audio | |
| target | number | |
| ceiling | number |
fadeOut(a: Audio, frames: number) → void
| arg | type | description |
|---|---|---|
| a | Audio | |
| frames | number |
fadeIn(a: Audio, frames: number) → void
| arg | type | description |
|---|---|---|
| a | Audio | |
| frames | number |
body(a: Audio) → void
Body of a generated track: drop a fade-in at the head and a fade-out/ending at the tail. Returns start and end frames.
| arg | type | description |
|---|---|---|
| a | Audio |
onsets(a: Audio, s: number, e: number) → void
onset-strength curve (positive energy flux) at 10 ms hops
| arg | type | description |
|---|---|---|
| a | Audio | |
| s | number | |
| e | number |
loop(a: Audio, xfadeSec: number, align: boolean) → void
Make a seamless loop from a generated track: trim its head and tail, pick the loop end whose rhythm lines up best with the head (onset cross-correlation), and crossfade the tail into the head (equal power). Returns the looped Audio and the loop info.
| arg | type | description |
|---|---|---|
| a | Audio | |
| xfadeSec | number | |
| align | boolean |
rotateQuiet(a: Audio, searchSec: number) → Audio
Rotate a finished (circular) loop so the wrap falls on the quietest, smoothest frame within the first `searchSec` seconds. The loop's content is unchanged; only where the buffer starts moves, so the join lands where the signal barely moves.
| arg | type | description |
|---|---|---|
| a | Audio | |
| searchSec | number |
rotateTo(a: Audio, k: number) → Audio
| arg | type | description |
|---|---|---|
| a | Audio | |
| k | number |
bestWrap(a: Audio, kbps: number, segments: number, fromSec: number?, toSec: number?) → void
Choose where a finished (circular) loop's buffer starts so the join survives the codec. Opus rebuilds a stream's first and last few ms from a hard edge, which can tick on a quiet, sparse bed even when the loop itself is seamless. Each of `segments` slices of [fromSec, toSec) offers its smoothest frame; every candidate is encoded at `kbps`, decoded, and the one whose join reads cleanest (build.audioCheck.wrapClick) wins. Returns the rotated loop and its click reading after the codec.
| arg | type | description |
|---|---|---|
| a | Audio | |
| kbps | number | |
| segments | number | |
| fromSec | number? | |
| toSec | number? |
oneShot(a: Audio, mode: string?, maxSec: number?) → Audio
Cut a one-shot: start just before the first strong onset, end when it has decayed, short fades at both ends. `mode` "step" keeps only the strongest single hit.
| arg | type | description |
|---|---|---|
| a | Audio | |
| mode | string? | |
| maxSec | number? |
write(folder: string, name: string, a: Audio, opts: any?) → any
| arg | type | description |
|---|---|---|
| folder | string | |
| name | string | |
| a | Audio | |
| opts | any? |
music(name: string, startSec: number?) → any
Master one music track: loop it (rhythm-aligned), level it, bake it as Opus.
| arg | type | description |
|---|---|---|
| name | string | |
| startSec | number? |
bed(name: string, segments: number?) → any
Master one ambience bed: loop it (plain long crossfade), level it, bake as Opus.
| arg | type | description |
|---|---|---|
| name | string | |
| segments | number? |
sfx(raw: string, out: string, maxSec: number?, level: number?) → any
Master one effect take: trim, level by its loudest 50 ms, bake mono.
| arg | type | description |
|---|---|---|
| raw | string | |
| out | string | |
| maxSec | number? | |
| level | number? |
step(raw: string, out: string, level: number, maxSec: number?) → any
Master one footstep take: keep the strongest single step, level it, bake mono.
| arg | type | description |
|---|---|---|
| raw | string | |
| out | string | |
| level | number | |
| maxSec | number? |
highpass(a: Audio, hz: number) → void
2nd-order Butterworth high-pass (RBJ), in place: takes out DC and sub-sonic drift
| arg | type | description |
|---|---|---|
| a | Audio | |
| hz | number |
limit(a: Audio, ceiling: number) → number
Peak limiter with 2 ms lookahead and 60 ms release: no sample leaves above `ceiling`, and the gain moves smoothly (never a sample-to-sample jump), so a raised take keeps its tone. Returns the deepest gain reduction in dB.
| arg | type | description |
|---|---|---|
| a | Audio | |
| ceiling | number |
scale(a: Audio, g: number) → void
| arg | type | description |
|---|---|---|
| a | Audio | |
| g | number |
matchTakes(paths: { string }, kbps: number, maxLimitDb: number?) → any
Even out the takes of one sound, in place on the shipped clips. Each take loses DC and sub-sonic drift (30 Hz high-pass) and gets clean 1 ms / 8 ms edges; then every take is brought to the sound's median one-shot loudness (loudest 200 ms, K-weighted) through the limiter. A take is raised by at most `maxLimitDb` of limiting past its own headroom, and the target drops (by 3 dB at most) when the quietest take cannot reach it. Only takes that changed are re-encoded (Opus at `kbps`). Returns per-take before/after.
| arg | type | description |
|---|---|---|
| paths | { string } | |
| kbps | number | |
| maxLimitDb | number? |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
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.