Soundscape
Everything the hill sounds like. One instance, on `mount_audio`.
game.audio.Soundscape
Everything the hill sounds like. One instance, on mount_audio.
local sound = entity.find("mount_audio").component.get("game.audio.Soundscape")
sound:say("open1") -- speak a line of the Old Henter's now
sound:hush() -- cut her off and clear the caption
sound:report() -- what the soundscape is doing, without ears
What it runs
The bed. bed_night and bed_dawn, two eight-second loops baked as
uncompressed PCM and closed end to end — the noise in them is filtered
circularly and every partial is a whole number of cycles long, so the last
sample runs into the first with no step. They play together and crossfade on
Core.state.dawn: wind and a low earth-drone in the deep of the night,
thinner air and a warm sustained chord by first light, and the whole bed sits
a little louder at the crest than it did at midnight. They loop on the Audio
component's own looping field.
The calls. A nightjar churrs out on the dark moor; a curlew answers as the
light comes up. Placed at a random point on the hill, spatial, heard from the
AudioListener on the CameraRig, on their own irregular clock.
The burn. A peaty moorland stream runs through the deepest hollow on the
playable field — found by sampling Core.ground against its neighbours, so it
sits where water would. Spatial and looping, closed the same way the beds are
(its own tail crossfaded into its head, then baked as PCM), so crossing the
hollow is something you hear before you see.
The crest. A synthesised swell rises through the last seventeen seconds
before the sun clears the cairn, and the generated cue lands on firstlight.
The swell is authored here, so the moment is scored whether or not the cue
generated.
The voice. The Old Henter speaks on her own long-lived source, so a line
can be cut cleanly. Every line goes out as a line event carrying its TEXT as
well as its clip — the words reach the caption band whether or not there is a
recording behind them, and a muted player still gets the line.
When she speaks
| Moment | Line |
|---|---|
phase → intro | open1, then open2 |
first butt of a round | firstbutt |
firstlight | firstlight |
phase → won | win |
phase → lost | lose |
Each is spoken once per round. say(id) overrides that, which is how staging
places the opening lines against its own camera move.
The mix
Set here every frame through audio.setChannelVolume, on five channels:
voice on top, then sfx, ui, music, ambient. The bed and the music
duck to about a third under the narrator and come back over a quarter of a
second, so she is never fought. Pausing drops the bed rather than cutting it.
Fields
| Field | Meaning |
|---|---|
bedVolume | how loud the night bed sits under everything else |
musicVolume | level of the music channel |
voiceVolume | level of the narrator's channel |
callSeconds | average seconds between one far-off bird call and the next |
auditionInEdit | sound the bed in edit mode as well as in play |
Scoped to this part · feeds back into the world's score.