TTS redeems: envelope letter with words inked in as spoken

- TTS alerts use the new `tts` style: envelope opens, the letter rises out
  and settles in front near the top, words ink in as the voice says them
  (timed from a loudness curve the server sends: tts.loudness, tts_env,
  tts_prefix); if the voice fails, the full text shows
- Highlight my message keeps its taped note

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-11-21 14:42:36 +02:00
parent 4fda6060bf
commit 060b2351f7
6 changed files with 122 additions and 9 deletions

View file

@ -129,7 +129,7 @@
name: e.user || 'Someone', line: fill(e.caption || 'redeemed it! ♡'), msg: e.input,
title: e.variation || e.reward, sub: e.reward, rarity: e.rarity,
sound: e.sound || null, volume: e.volume, soundOnly: e.polaroid === false && !e.tts,
tts: e.tts ? rebase(e.tts) : null, ttsMs: e.tts_ms || 0 };
tts: e.tts ? rebase(e.tts) : null, ttsMs: e.tts_ms || 0, ttsEnv: e.tts_env || [], ttsPrefix: e.tts_prefix || 0 };
}
case 'bits': {
if (!(e.bits >= BITS_MIN)) return null;
@ -255,7 +255,7 @@
const len = url ? await soundLength(url) : 0;
if (cur !== current) return; // skipped while measuring the sound
const fx = { emote: 'giant', emote_rain: 'rain', message: 'message' }[d.style];
const fx = { emote: 'giant', emote_rain: 'rain', message: 'message', tts: 'envelope' }[d.style];
if (fx && !d.soundOnly && window.FxAlert) {
return window.FxAlert[fx](d, cur, { url, len, volume: d.volume ?? VOLUME })
.then(() => { if (current === cur) current = null; });