bsc_audio
The sound of Hozumi-dori 3-chome: the ambience beds, the three radio stations, the score, the mix, and every voiced line.
bsc_audio
The sound of Hozumi-dori 3-chome: the ambience beds, the three radio stations, the score, the mix, and every voiced line.
What it gives the other slices
BSC.clips is filled here and read everywhere:
| bank | keys |
|---|---|
BSC.clips.sfx | ui_move ui_select ui_back ui_slam lantern_up timer_beep radio_static radio_tune engine_loop door_open door_close engine_start horn impact_light impact_hard siren skid footstep_asphalt footstep_gravel shrine_bell |
BSC.clips.music | title tension finale radio_sodapop radio_namida radio_talkbed |
BSC.clips.ambient | day night laundry vending konbini train |
BSC.clips.voice | the 22 line keys |
Calls:
M.play(key, x?, y?, z?)— fire a library key, positionally if a point is given.M.clip(key)— resolve"sfx.horn"or a bare"horn"to its clip.M.say(lineKey)— speak a line and put its written text on screen.M.setStation(i)/M.nextStation()— change radio station.M.setHour(h)— cross the day bed over to the night bed.M.report()— what the mix is doing right now.M.VENDING— the points the vending-machine hum comes from.M.LINES[key] = { who, text }— the written form of every spoken line.
What it listens to
footstep · carEnter · carExit · heat · busted · hit · voice ·
phase · hour · missionStart · missionDone
Playing it
The radio changes station with R. It is loud in the car and a murmur on the street. NIGHT TALK 1422 puts Hamada-san on the air over its own bed, and prints what he says.
The clips
Every clip is a committed .soundClip under /zero/source/audio, so nothing
is generated while somebody is playing. Beds are stored uncompressed and
crossfaded seamless end to end so they loop without a seam; one-shots are
compressed with a short silent head so the first sound is never clipped.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
pin(name: string, ref: any) → any
Every clip is resolved by a static literal so the reference is pinnable and the world publishes with its audio attached. `pin` only records the misses.
| arg | type | description |
|---|---|---|
| name | string | |
| ref | any |
emitter(root: any, name: string, init: { [string]: any }, pos: { number }?) → any
Spawn an emitter under AudioRoot and keep both the entity and its Audio. Nine agents share this engine, so a module reload or a scene reload can land at any moment: an emitter left over from a previous build is despawned first rather than duplicated.
| arg | type | description |
|---|---|---|
| root | any | |
| name | string | |
| init | { [string]: any } | |
| pos | { number }? |
fire(clipRef: any, volume: number, pitch: number) → void
Between an emitter set being cleared and the next one being spawned there are a few frames with no voices at all, and the game keeps emitting footsteps through them. A shot fired into that window has nothing to play on: drop it rather than raising out of a bus listener on every step.
| arg | type | description |
|---|---|---|
| clipRef | any | |
| volume | number | |
| pitch | number |
fireAt(clipRef: any, x: number, y: number, z: number, volume: number, pitch: number) → void
One-shot at a world point: move the host, then play.
| arg | type | description |
|---|---|---|
| clipRef | any | |
| x | number | |
| y | number | |
| z | number | |
| volume | number | |
| pitch | number |
fireLine(clipRef: any, volume: number, pitch: number) → void
| arg | type | description |
|---|---|---|
| clipRef | any | |
| volume | number | |
| pitch | number |
subtitle(text: string) → void
Put a line on screen. Guards against the same words arriving twice from two slices within a moment of each other.
| arg | type | description |
|---|---|---|
| text | string |
play(key: string, x: number?, y: number?, z: number?) → void
the published interface Play a library key by name. `sfx.horn`, `voice.m1_brief`, `ui_select`, or a bare key that exists in any bank. Positional when x/y/z are given.
| arg | type | description |
|---|---|---|
| key | string | |
| x | number? | |
| y | number? | |
| z | number? |
clip(key: string) → any
Resolve a library key to a clip ref. Accepts "bank.key" or a bare key.
| arg | type | description |
|---|---|---|
| key | string |
say(lineKey: string) → void
Speak a line: audio if it exists, words on screen either way.
| arg | type | description |
|---|---|---|
| lineKey | string |
setStation(i: number) → void
Change station. Wraps; writes BSC.state.radioStation (this slice owns it).
| arg | type | description |
|---|---|---|
| i | number |
nextStation( ) → void
teardown( ) → void
Cancel an in-flight build and drop the bus subscriptions. The slice is driven by BscBoot for the life of the session, so nothing calls this in normal play — it exists so a session that is tearing the world down can stop the mix without leaving a coroutine behind.
report( ) → void
What the mix is doing right now — for anyone verifying it.
loadLibrary( ) → void
build
buildEmitters(root: any) → void
| arg | type | description |
|---|---|---|
| root | any |
setScore(name: string?, vol: number) → void
| arg | type | description |
|---|---|---|
| name | string? | |
| vol | number |
wireBus( ) → void
setHour(h: number) → void
Day sits over night between 06:00 and 18:00, with an hour of overlap at each end so the block changes its mind slowly.
| arg | type | description |
|---|---|---|
| h | number |
clearEmitters(root: any) → void
Clear whatever a previous build (or a previous copy of this module) left under the anchor, in one pass over the anchor's children rather than 28 lookups. Nine agents share this frame budget.
| arg | type | description |
|---|---|---|
| root | any |
build( ) → void
The build runs as a task that yields, because it spawns 28 emitters and this is called from BscBoot's per-frame update: done inline it trips the 1000 ms script watchdog on a loaded engine and the slice never finishes building.
approach(v: number, target: number, rate: number, dt: number) → number
update
| arg | type | description |
|---|---|---|
| v | number | |
| target | number | |
| rate | number | |
| dt | number |
setVolume(name: string, v: number) → void
| arg | type | description |
|---|---|---|
| name | string | |
| v | number |
emittersAlive( ) → boolean
On a world nine agents are writing to, a module reload or a scene reload can take the emitters out from under us. Every proxy this slice holds would then raise on the next frame, which is how a slice goes permanently silent while reporting ready. So the mix checks it still has ears before it uses them, and puts them back if it does not.
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | 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.
Showing the 199 items nearest this part. It holds more than this page lists.
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.