// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Captioned sound exhibit // Not compiled or tested in-world // Setup: Add a licensed sound named exhibit_sound. Set CAPTION to accurately describe that sound and SECONDS to its approximate duration. Owner-touch plays it. // Stop / restore: Wait for the caption timer to restore the original text before removing. Stop sound in this prim can silence a remaining clip. // Notes: Caption is authored text, not automatic transcription. Helps visitors who mute sound or cannot hear it; no recording or external service is involved. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. string SOUND = "exhibit_sound"; string CAPTION = "[A soft wooden chime rings once]"; float SECONDS = 4.0; list original; integer busy; default { state_entry() { original = llGetLinkPrimitiveParams(LINK_THIS, [PRIM_TEXT]); } touch_start(integer count) { if (llDetectedKey(0) != llGetOwner() || busy) return; if (llGetInventoryType(SOUND) != INVENTORY_SOUND) { llOwnerSay("Add exhibit_sound to this prim."); return; } if (SECONDS < 1.0) SECONDS = 1.0; busy = TRUE; llSetText(CAPTION, <0.95, 0.95, 0.85>, 1.0); llPlaySound(SOUND, 0.35); llSetTimerEvent(SECONDS); } timer() { busy = FALSE; llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXT] + original); } }