// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Inventory sound audition // Not compiled or tested in-world // Setup: Add licensed sounds to the same prim. Touch to cycle alphabetically through them. // Stop / restore: Disable or remove and run Stop sound in this prim if a clip is still playing. // Notes: Playback is audible nearby; owner-only triggering does not make audio private. A new selection interrupts the previous attached sound. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. integer index; default { touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; integer total = llGetInventoryNumber(INVENTORY_SOUND); if (!total) { llOwnerSay("Add a licensed sound to this prim."); return; } index = index % total; string sound = llGetInventoryName(INVENTORY_SOUND, index++); llStopSound(); llPlaySound(sound, 0.35); llOwnerSay("Preview: " + sound); } }