Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 8c90d7c4-9…

RaceAudio

Every sound the race makes, behind one interface. `RaceDirector` calls it; no one else needs to know how the mix is wired.

by◐Doomin·posted 5d ago
What it does

RaceAudio

Every sound the race makes, behind one interface. RaceDirector calls it; no one else needs to know how the mix is wired.

The module owns no geometry. On the first call it spawns its own temporary, internal audio entities under a RaceAudioRig root and attaches an Audio component to each — four looping beds and six one-shots — then finds them by name ever after, so a second setup() rebuilds rather than duplicates and a scene reload costs one rebuild. Every function is safe to call before setup, and none of them throws: a clip that will not resolve leaves that one voice silent and is reported, never raised.

What it exports

FunctionWhat it does
setup()Idempotent. Builds the ten voices once, then settles the mix into whichever state the race is in: the menu bed when nothing runs, the race beds when one does. Every volume it owns is re-asserted, so a second call also undoes drift.
startRace()The gates open — the claxon and its crowd roar, hooves away, the race bed under them, the start-screen theme out of the way, and the grandstand swelling.
stop()The race is over — race bed, hooves and the caller go quiet, the crowd settles to its between-races level, and the menu bed comes back under the result screen.
setCrowd(level)0..1 excitement, mapped onto the grandstand bed's volume. Recorded even before setup, applied as soon as the bed is alive.
sting(kind)"win" or "lose" — the result sting. Any other value is a quiet no-op.
say(text)Plays the race-caller reading of a commentary line, if one exists for that text. Otherwise silent. The same line will not retrigger within 2.5 s.

Which clip plays where

All clips live in /zero/source/audio/ and were generated for this game.

ClipUsed forMix
race_day_themeStart screen and result screen — golden-hour fanfare, strings and brass, 54 s loopmusic channel, 0.55
race_bedThe field running — string ostinato under taiko, 60 s loopmusic channel, 0.52
start_gate_claxonThe gates opening — bell over a crowd roar, 2.5 s one-shotsfx, 0.9
crowd_bedThe packed grandstand, 8 s loop, always under everythingambient, 0.10 → 0.72 with setCrowd
hooves_turfThe pack passing — hoofbeats on turf, 4 s loop, races onlysfx, 0.5
sting_winFirst place — brass flourish and a cheer, 4 ssfx, 0.9
sting_loseAnything else — muted trombone and a sigh, 3 ssfx, 0.9
lines/line_start · lines/line_final · lines/line_holdRace-caller commentary — 「各馬スタートしました!」, 「最後の直線、外から1番が伸びてくる!」, 「そのまま押し切る!」sfx, 0.9

All four looping beds read seamless on clipRef:loopSeam(), so none of them ticks at the wrap.

say matches a commentary line exactly first, then falls back to a keyword (スタートしました, 最後の直線, 押し切) so the director's dynamic lines — the leader's number, the finishing call — borrow the nearest reading instead of going silent.

Adding a line

Drop the clip under audio/lines/, resolve it in the REF table from its literal identity, add a voice to VOICES, list it in LINES, and point the commentary text at it in SPEECH.

One entity per spoken line, on purpose: a voice whose clip is swapped mid-flight loses the source it was playing, so lines never share one.

Identities are written as literals: a computed asset.resolve records nothing in the world's reference table, so the clip would not travel with the world.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

RaceAudio — every sound the race makes. `RaceDirector` calls it by name: setup / startRace / stop / setCrowd / sting / say. It owns no scene geometry: it spawns its own temporary audio entities the first time it is asked and finds them by name afterwards, so a second call rebuilds rather than duplicates. Every call is safe before setup and never throws — a clip that will not resolve leaves that one voice silent instead of breaking the race.

Audio

pinned(body: () → void

Generated with the audio service, filed under /zero/source/audio/. Each is resolved from a literal identity so the world's reference table records what this module plays; a computed name would record nothing and would not travel with the world.

argtypedescription
body(

attempt(what: string, body: () → void

Run a step the race must survive: a failure is reported, never raised.

argtypedescription
whatstring
body(

audioOn(ent: any) → any

argtypedescription
entany

rig( ) → any

crowdVolume( ) → number

setVolume(comp: any, value: number) → void

argtypedescription
company
valuenumber

voice(key: string) → any

The voice's component, spawning the entity and attaching the source if they are not there. Nil when the voice is unknown or could not be built.

argtypedescription
keystring

live(key: string) → any

The voice only if it is already alive — for calls that must not spawn.

argtypedescription
keystring

start(key: string, volume: number?) → void

argtypedescription
keystring
volumenumber?

halt(key: string) → void

argtypedescription
keystring

strike(key: string) → void

A one-shot: back to the head of its clip and away.

argtypedescription
keystring

setup( ) → void

Idempotent. Builds the ten voices once, re-asserts their mix, then settles them into the state the race is in: the menu bed while nothing runs, the race beds while one does.

startRace( ) → void

The gates open: the claxon and its roar, the hooves away, the race bed under them, and the start-screen music out of the way.

stop( ) → void

The race is over: the race beds and the caller go quiet, the grandstand settles, and the menu bed comes back under the result screen.

setCrowd(level: number) → void

excitement 0..1 for the grandstand. Recorded even before setup, and applied on the next call that finds the bed already alive.

argtypedescription
levelnumber

sting(kind: string) → void

"win" | "lose" — the result sting.

argtypedescription
kindstring

say(text: string) → void

Speak a commentary line, if the caller has a reading of it. Anything else is a quiet no-op.

argtypedescription
textstring

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

63items
·
soundclip · born here
❒asset
# line_start A race caller, excited and fast, announcing the break: 「各馬スタートしました!」 — "they're away!" 1.5 seconds, mono speech. `RaceAudio.say` plays it when the commentary reaches that line at the gates opening, on the `sfx` channel at 0.9.
▲ 0↑ born
·
soundclip · born here
❒asset
# line_hold The race caller as the leader kicks for the line: 「そのまま押し切る!」 — "and they hold them all off!" 1.5 seconds, mono speech. `RaceAudio.say` plays it when the commentary reaches that line, on the `sfx` channel at 0.9. `RaceAudio` also borrows it for the director's finishing call, which has no recording of its own.
▲ 0↑ born
·
soundclip · born here
❒asset
# line_final The race caller as the field turns for home: 「最後の直線、外から1番が伸びてくる!」 — "into the final straight, number one is coming on the outside!" 3.3 seconds, mono speech. `RaceAudio.say` plays it when the commentary reaches that line, on the `sfx` channel at 0.9. `RaceAudio` also borrows it for the director's other 最後の直線 calls, which have no recording of their own.
▲ 0↑ born
·
soundclip · born here
❒asset
# race_day_theme The race-day fanfare: warm sweeping strings under a bright brass theme, with koto and shamisen accents and a light taiko pulse. Golden-hour, heroic and nostalgic, in a major key at about 100 bpm. 54 seconds, stereo, and its loop seam reads seamless — it is the menu bed the start screen and the result screen sit on, played by `RaceAudio` on the `music` channel at 0.55.
▲ 0↑ born
·
soundclip · born here
❒asset
# crowd_bed A packed grandstand at a race meeting: thousands of spectators as a dense murmur with surges of cheering and roaring, wide and distant, no music and no announcer. Held at an even level so it cycles without a step. 8 seconds, stereo, seamless loop — the bed that always sits under the race, played by `RaceAudio` on the `ambient` channel. Its volume follows `RaceAudio.setCrowd(level)`, from 0.10 with a quiet course up to 0.72 at full excitement, so the grandstand rises as the field closes.
▲ 0↑ born
·
soundclip · born here
❒asset
# sting_win The victory sting: a bright brass fanfare flourishes onto a big major chord as a large crowd erupts into cheering and applause. 4 seconds, stereo, one-shot — played by `RaceAudio.sting("win")` when the player's horse takes first, on the `sfx` channel at 0.9, over the result screen.
▲ 0↑ born
·
soundclip · born here
❒asset
# race_bed The in-race music: a relentless driving string ostinato over a low cello pulse, sharp taiko accents, brass swells entering as the field winds up. About 138 bpm, dark and thrilling rather than triumphant. 60 seconds, stereo, seamless loop — the bed the field runs to, played by `RaceAudio` from the gates opening until the result, on the `music` channel at 0.52.
▲ 0↑ born
·
soundclip · born here
❒asset
# hooves_turf A tight rhythmic loop of several horses at full gallop on soft turf: rapid four-beat hoofbeats, muffled thuds with a little dirt and grass spray, passing close by. Nothing else in it, so it layers cleanly under the race bed. 4 seconds, stereo, seamless loop — started by `RaceAudio.startRace()` and stopped at the result, on the `sfx` channel at 0.5, for the pack going past.
▲ 0↑ born
·
soundclip · born here
❒asset
# start_gate_claxon The starter's bell: a sharp metal claxon ringing out, then a huge crowd roar swelling up behind it as the gates open. Wide and distant, a packed grandstand rather than a few spectators. 2.5 seconds, stereo, one-shot — played by `RaceAudio.startRace()` on the `sfx` channel at 0.9, the moment the race begins.
▲ 0↑ born
·
soundclip · born here
❒asset
# sting_lose The defeat sting: a short muted trombone and low string figure falling away, with a disappointed crowd sighing somewhere in the distance. Gentle and subdued, not harsh — the race did not go your way. 3 seconds, stereo, one-shot — played by `RaceAudio.sting("lose")` whenever the player's horse comes home anywhere but first, on the `sfx` channel at 0.9, over the result screen.
▲ 0↑ born
backing path · RaceAudio.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.