Sync MicroslopSam VOX mode and path configuration
This commit is contained in:
+105
@@ -335,6 +335,111 @@ How to apply a change:
|
||||
5. Runtime `ITTSAttributes` pitch/speed/volume layer on top of the profile: the profile
|
||||
defines the natural values, the attributes shift them per request.
|
||||
|
||||
### VOX mode (NetTTS-inspired, Flextalk only)
|
||||
|
||||
`VESKSLOP_TTS_VOX=1` routes the text through a rule-based prosody encoder before
|
||||
synthesis. `setup/vox_parser.py` is an independent reimplementation of the VOX parser
|
||||
from [h4rm0n1c/NetTTS](https://github.com/h4rm0n1c/NetTTS), which models Half-Life's
|
||||
Black Mesa announcement delivery. It was verified byte-identical to the NetTTS parser
|
||||
on a 31-line corpus (the reference was built locally with g++ for the comparison).
|
||||
|
||||
What it does: sentence splitting; `the` -> `thee` before prepositions, proper nouns,
|
||||
single letters or numbers; lead-in breaks ("Now...", "Please...", "A reminder...");
|
||||
time/number/degree normalization; token weighting (light/medium/heavy) with break
|
||||
insertion at linkers, title-case runs, heavy gates and a 3-beat limiter; letter
|
||||
tokens (`A` -> `Ay:`, `C` -> `C:`); `\!sf500 \!br` at sentence ends; and the
|
||||
`\!wH1 ... \!wH0` staccato wrapper (disable with `VESKSLOP_TTS_VOX_CLEAN=1`).
|
||||
|
||||
Requirements and scope:
|
||||
|
||||
- Flextalk voices only: `\!br`, `\!sfNN` and `\!wH1/\!wH0` are FlexTalk vendor tags.
|
||||
The host passes `TTSDATAFLAG_TAGGED`, so the engine honors them. Other voices ignore
|
||||
`VESKSLOP_TTS_VOX`.
|
||||
- Needs `python3` at runtime; the wrapper fails loudly when it is missing.
|
||||
- Mutually exclusive with `VESKSLOP_TTS_WORDS` (VOX wins).
|
||||
- Measured on the dev host for "Now approaching Sector C test lab. Please stand clear
|
||||
of the test chamber.": plain 4.70 s with 1 pause, VOX 7.81 s with 8 pauses.
|
||||
|
||||
Other NetTTS features and their relevance:
|
||||
|
||||
- Inline `/rate N`, `/pitch N`, `[[pause N]]`: not ported. Veskslop has speed/pitch
|
||||
controls and the profile window; `[[pause N]]` could be added as a wrapper-level
|
||||
text splitter later (NetTTS supports it only outside VOX mode).
|
||||
- TCP server with `START`/`STOP` status sockets: not needed; Veskslop owns playback
|
||||
and knows when a line ends.
|
||||
- Winetricks prefix automation (`winxp`, `vcrun6`, `mfc42`, `riched20`): not needed;
|
||||
our prefix runs the engines with builtin Wine libraries.
|
||||
- Win32 GUI and preset sliders: Veskslop provides the UI.
|
||||
|
||||
### Inline rate/pitch controls (engine-side)
|
||||
|
||||
The wrapper consumes NetTTS-style, line-leading controls, so Veskslop and the WebUI do
|
||||
not need to parse or implement them:
|
||||
|
||||
/rate 150 Attention all personnel. # 150% rate, then the line
|
||||
/pitch 90 Attention all personnel. # 90% pitch
|
||||
/rate 120 /pitch 110 Inbound tram. # both, in any order
|
||||
|
||||
- `N` is a percent (100 = normal, clamped to 0-200); values `<= 2.0` are multipliers
|
||||
(`/rate 1.5` = 150%).
|
||||
- They override `VESKSLOP_TTS_SPEED` / `VESKSLOP_TTS_PITCH` for that line and are not
|
||||
spoken.
|
||||
- A line that contains only controls yields 100 ms of silence, so the daemon always
|
||||
receives a valid WAV.
|
||||
- Rate maps through the normal speed scale; pitch percent maps to semitones
|
||||
(`st = 12*log2(N/100)`) and then through the per-voice natural pitch.
|
||||
- Verified on the dev host: `/rate 50` doubles the line duration; `/pitch 150` raises
|
||||
the median F0 from 122 Hz to 177 Hz.
|
||||
|
||||
### Paths and configuration (standalone)
|
||||
|
||||
The engine project is standalone and archival: it has no path dependency on Veskslop,
|
||||
and every non-installable dependency is vendored under `third_party/`, so nothing is
|
||||
fetched from the network at build or run time:
|
||||
|
||||
- `third_party/speech.h` — SAPI4 SDK header used by the build.
|
||||
- `third_party/sapi4/` — SAPI4 runtime (`SPEECH.DLL` + INF), MSTTS engine + voices,
|
||||
and the original installers.
|
||||
- `third_party/flextalk/data1.cab` — AT&T Flextalk installer (Keith Bell / Kerry Watson).
|
||||
- `third_party/nettss-reference/` — NetTTS VOX parser source, kept to validate
|
||||
`setup/vox_parser.py`.
|
||||
|
||||
Only toolchain packages are installed by `setup/install-deps.sh` (Wine/Winelib, ffmpeg,
|
||||
python3, unshield, mingw). Everything else lives in the repository.
|
||||
|
||||
`setup/install.sh` writes `setup/microslopsam.env` with absolute paths; environment
|
||||
variables take precedence over that file, so anything can be relocated without editing
|
||||
scripts:
|
||||
|
||||
| Variable | Default | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `MICROSLOP_ROOT` | repo root | project root |
|
||||
| `MICROSLOP_BUILD` | `$MICROSLOP_ROOT/build` | host binaries, samples |
|
||||
| `MICROSLOP_PREFIX` | `~/.wine-microslopsam` | wine prefix (exported as `WINEPREFIX`) |
|
||||
| `MICROSLOP_ASSETS` | `third_party/sapi4` | SAPI4/MSTTS payloads (vendored) |
|
||||
| `MICROSLOP_FLEXTALK_DIR` | `third_party/flextalk` | Flextalk cabinet/extraction (vendored) |
|
||||
| `MICROSLOP_SPEECH_H_DIR` | `$MICROSLOP_ROOT/third_party` | `speech.h` include dir (vendored) |
|
||||
| `MICROSLOP_DISPLAY` | `:77` | Xvfb display used for Wine |
|
||||
| `MICROSLOP_WINE` / `_XVFB` / `_PYTHON` / `_FFMPEG` | tool names | tool overrides |
|
||||
|
||||
The wrapper needs only `VESKSLOP_TTS_CMD` to point at its absolute path; it derives
|
||||
everything else from its own location plus the env file.
|
||||
|
||||
### Merging into Veskslop
|
||||
|
||||
This tree is written to survive a copy into the Veskslop repository next to its daemon:
|
||||
|
||||
1. Copy `microslopsam/` (or replace the existing copy). The vendored assets under
|
||||
`third_party/` come along, so the merged tree stays self-contained. Then refresh the
|
||||
configuration: `MICROSLOP_UPDATE_ENV=1 microslopsam/setup/install.sh`. Re-running
|
||||
install is idempotent; it rewrites `setup/microslopsam.env` for the new absolute paths.
|
||||
2. No daemon changes are required. The env/placeholder contract is unchanged
|
||||
(`VESKSLOP_TTS_*`, `{out}`, `{text_file}`, voice/speed/pitch/expression/profile/
|
||||
highpass/echo/words/word_gap_ms). New features are additive and default off.
|
||||
3. Optional Veskslop-side follow-up: a `tts.vox` preference that exports
|
||||
`VESKSLOP_TTS_VOX` (like `words`) and a line in the TTS panel help. The inline
|
||||
`/rate` and `/pitch` controls need no UI work at all.
|
||||
|
||||
### Transport and latency
|
||||
|
||||
- Installation is one command: `setup/install.sh` (system dependencies with sudo, wine
|
||||
|
||||
Reference in New Issue
Block a user