From 267c31337cb8812ebae93157bf1e1b567fe1cb29 Mon Sep 17 00:00:00 2001 From: Fisto Date: Mon, 21 Sep 2026 18:29:13 +0200 Subject: [PATCH] Keep the TTS echo at unity gain so the level drives the repeats --- CURRENT.md | 7 +++++++ microslopsam/docs/TTS-DESIGN.md | 2 +- microslopsam/setup/veskslop-tts.sh | 16 +++++++++++++--- poc/public/index.html | 5 +++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CURRENT.md b/CURRENT.md index 77977e3..62c5033 100644 --- a/CURRENT.md +++ b/CURRENT.md @@ -40,6 +40,13 @@ mobile draft at 390px. - [x] C11 preview caching: Discord-hosted image/GIF previews (WebP 320px, hash-addressed, 5 MiB cap, one attempt) run after every walk in both modes. Live run `...-20260916090722`: `previewed: 2`; thumbs served over `/api/media///thumb` (200). + - [x] C73 Echo on the vox voice. `aecho`'s `in_gain`/`out_gain` scale the dry signal + as well as the repeats, so a low echo level quieted the whole line (the classic path's + loudnorm hid it; the streaming path has no measurement, so vox + stream word mode just + went quiet and the echo disappeared). The stage now runs at unity gain and the level + scales the repeats, with a limiter absorbing the summed peaks. Verified with the user's + settings: the no-echo, mild, and strong cases keep the same voice RMS while the echo + tail grows with the delay. Wrapper tests pass. - [x] C72 Voice processing settings and the speak bypass. The TTS panel gained a **voice processing** block (echo cancellation, auto gain, noise cancellation, and **off while speaking**), stored in `preferences.voice` and applied live on save. While a TTS burst plays, diff --git a/microslopsam/docs/TTS-DESIGN.md b/microslopsam/docs/TTS-DESIGN.md index 5ebdbfb..027af6f 100644 --- a/microslopsam/docs/TTS-DESIGN.md +++ b/microslopsam/docs/TTS-DESIGN.md @@ -665,7 +665,7 @@ Inputs: `{out}`, `{text_file}`, optional positional voice/speed/pitch/expression | --- | --- | | `VESKSLOP_TTS_PROFILE` | `pitch:27:...`/`key=value,...` overrides; the wrapper writes the full profile (defaults + overrides) to the Wine registry with `wine reg import` before every synthesis. | | `VESKSLOP_TTS_HIGHPASS` | High-pass Hz, 40-400 (default 40). | -| `VESKSLOP_TTS_ECHO` | Mono echo 0-100 (`aecho`), default 0. | +| `VESKSLOP_TTS_ECHO` | Mono echo 0-100 (`aecho`), default 0. The echo is mixed under the dry voice, so the voice level does not change. | | `VESKSLOP_TTS_WORDS` / `VESKSLOP_TTS_WORD_GAP_MS` | Word-by-word synthesis with silence gaps (Flextalk only). | Placeholders `{profile}`, `{highpass}`, `{echo}`, `{words}`, `{word_gap_ms}` mirror the env vars. diff --git a/microslopsam/setup/veskslop-tts.sh b/microslopsam/setup/veskslop-tts.sh index 8dafc79..359b885 100755 --- a/microslopsam/setup/veskslop-tts.sh +++ b/microslopsam/setup/veskslop-tts.sh @@ -17,7 +17,8 @@ # VESKSLOP_TTS_HIGHPASS high-pass Hz (40-400, default 40) # VESKSLOP_TTS_ECHO mono echo amount 0-100 (default 0) # VESKSLOP_TTS_ECHO_DELAY_MS echo delay 10-400 (default 60) -# VESKSLOP_TTS_ECHO_LEVEL echo output gain 0-0.95 (default 0.85) +# VESKSLOP_TTS_ECHO_LEVEL echo repeat level 0-0.95, relative to the +# dry voice (default 0.85) # VESKSLOP_TTS_CRUNCH off | hl90 | hl90hq | telephone | adpcm | crush # (1990s lossy character, applied last) # VESKSLOP_TTS_CRUNCH_BITS 1-16, overrides the preset bit depth @@ -495,9 +496,18 @@ ECHO_LEVEL=$(awk -v v="$ECHO_LEVEL" 'BEGIN{ if (v<0) v=0; if (v>0.95) v=0.95; pr SIL="silenceremove=start_periods=1:start_duration=0.05:start_silence=0.03:start_threshold=-50dB" PRE="highpass=f=$HIGHPASS,$SIL,afade=t=in:st=0:d=0.008,areverse,$SIL,afade=t=in:st=0:d=0.008,areverse" +# aecho's in_gain/out_gain scale the dry signal as well, so a low ECHO_LEVEL used to +# quiet the whole line (and the streaming path, which skips the loudness measurement, +# had nothing to make it up). Keep both gains at unity and let the repeats' decay carry +# the level; the limiter absorbs the summed peaks. if [ "$ECHO" -gt 0 ]; then - DECAY=$(awk -v e="$ECHO" 'BEGIN{printf "%.2f", 0.2 + e * 0.006}') - PRE="$PRE,aecho=0.8:${ECHO_LEVEL}:${ECHO_DELAY}:${DECAY}" + DECAY=$(awk -v e="$ECHO" -v l="$ECHO_LEVEL" 'BEGIN{ + d = (0.2 + e * 0.006) * (l / 0.85); + if (d < 0.02) d = 0.02; + if (d > 0.95) d = 0.95; + printf "%.2f", d + }') + PRE="$PRE,aecho=1:1:${ECHO_DELAY}:${DECAY},alimiter=limit=0.98:level=disabled" fi # Compression stage ("crunch"): the lossy 1990s codec character, built as its own diff --git a/poc/public/index.html b/poc/public/index.html index 1d18e8b..e3db252 100644 --- a/poc/public/index.html +++ b/poc/public/index.html @@ -561,8 +561,9 @@ off delay - level - + lvl +
crunch