Log inGet started
World

The Hernsew Lingster

Branchmain
Branchesmain
Commitc51c06f1f8

README.md

sound.voice

The one call the rest of the game makes to be heard.

local Voice = require("sound.voice")

Voice.line("tongue.reedgate.call")              -- a written line, spoken
Voice.say("Walk on, then.", "The Lingster")     -- free text, spoken if it was baked
Voice.sfx("answer_right")                       -- a one-shot, flat
Voice.sfx("sfx_splash", { x = 0, y = 0, z = 84 })  -- a one-shot, out there
Voice.ui("click")                               -- the interface answering

A spoken line always has its text on screen

Every call that speaks also raises hernsew:say with the text, the speaker's name, and the clip's real length, read off the payload's own header. The screens slice's caption queue listens on that signal, so the words are up for exactly as long as the voice is — and a line whose clip was never baked still goes up, unvoiced. The return value says only whether it was heard.

Everything here is guarded

A clip that was never baked, an anchor that has not spawned yet, a slice that loaded before the mix did — each of them makes this quiet, never an error. A game taken down by a missing noise is a worse failure than a game missing a noise.

Surface

CallDoes
line(id, opts?)speak a line of the written script by id
say(text, who?)speak free text; matches it against the script
sfx(name, at?, opts?)a one-shot from sound.clips, flat or placed
ui(kind)"click" / "hover" / "back" / "page"
lines()the whole spoken script, for anybody baking or listing it
clipFor(id) / lengthOf(id)the clip and its true length
isSpeaking() / lastLine() / stop()what is being said right now
ready()whether the mix is up and holding emitters

__attach / __detach are the mix component's own; nothing else calls them.