Expose the Half-Life voices and tidy the radio kit

This commit is contained in:
Fisto
2026-09-21 12:38:47 +02:00
parent c66d00ee59
commit baaaba3dcd
7 changed files with 61 additions and 49 deletions
+8 -18
View File
@@ -2033,10 +2033,7 @@ function fillProfileControls() {
$("#tts-stream-words").checked = state.speech.streamWords !== false;
$("#tts-words").checked = state.speech.words === true;
$("#tts-preset").value = state.speech.preset ?? "";
$("#tts-vox").checked = state.speech.vox === true;
$("#tts-vox-clean").checked = state.speech.voxClean === true;
$("#tts-vox-clean").disabled = state.speech.vox !== true;
const gap = Number(state.speech.wordGapMs);
$("#tts-word-gap").value = Number.isFinite(gap) && state.speech.wordGapMs !== null ? gap : 120;
$("#tts-word-gap-value").textContent = `${$("#tts-word-gap").value}ms`;
@@ -2069,9 +2066,10 @@ function effectOptions() {
echo: Number($("#tts-echo").value),
words: $("#tts-words").checked,
wordGapMs: Number($("#tts-word-gap").value),
vox: $("#tts-vox").checked,
// VOX and the Half-Life profile are part of the `vox`/`hev` voices now.
vox: false,
preset: null,
voxClean: $("#tts-vox-clean").checked,
preset: $("#tts-preset").value || null,
echoDelayMs: $("#tts-echo-delay").value ? Number($("#tts-echo-delay").value) : null,
echoLevel: $("#tts-echo-level").value ? Number($("#tts-echo-level").value) : null,
crunch: $("#tts-crunch").value || null,
@@ -2084,6 +2082,10 @@ function syncVoiceControls(voices, selected) {
const voice = (voices ?? []).find(entry => entry.id === selected);
const pitchable = !voice || voice.supportsPitch !== false;
// The Half-Life voices carry VOX prosody; their clean toggle lives in the profile area.
const voxOptions = $("#tts-vox-options");
if (voxOptions) voxOptions.hidden = selected !== "vox";
$("#tts-pitch-control").hidden = !pitchable;
$("#tts-pitch").disabled = !pitchable;
@@ -2753,19 +2755,7 @@ function init() {
$(`#${id}`).addEventListener("change", () => void saveSpeech());
}
$("#tts-words").addEventListener("change", () => void saveSpeech());
$("#tts-vox").addEventListener("change", () => {
$("#tts-vox-clean").disabled = !$("#tts-vox").checked;
void saveSpeech();
});
$("#tts-preset").addEventListener("change", () => {
// Picking the VOX preset turns on VOX prosody as a default. Word mode still wins
// for word-by-word delivery, and turning VOX off keeps the preset.
if ($("#tts-preset").value === "vox") {
$("#tts-vox").checked = true;
$("#tts-vox-clean").disabled = false;
}
void saveSpeech();
});
$("#tts-vox-clean").addEventListener("change", () => void saveSpeech());
$("#tts-vox-clean").addEventListener("change", () => void saveSpeech());
for (const id of [
"#tts-echo-delay",
+15 -23
View File
@@ -550,8 +550,10 @@
<span class="vk-micro-label">echo</span>
<input id="tts-echo" type="range" min="0" max="100" step="5" value="0" />
<span id="tts-echo-value" class="vk-mono vk-dim">off</span>
<input id="tts-echo-delay" class="input vk-num" type="number" min="10" max="400" placeholder="ms" />
<input id="tts-echo-level" class="input vk-num" type="number" min="0" max="0.95" step="0.05" placeholder="lvl" />
<span class="vk-micro-label">delay</span>
<input id="tts-echo-delay" class="input vk-num" type="number" min="10" max="400" />
<span class="vk-micro-label">level</span>
<input id="tts-echo-level" class="input vk-num" type="number" min="0" max="0.95" step="0.05" />
</div>
<div class="vk-profile-row">
<span class="vk-micro-label">crunch</span>
@@ -563,38 +565,28 @@
<option value="adpcm">ADPCM · 4-bit</option>
<option value="crush">crush · custom</option>
</select>
<input id="tts-crunch-bits" class="input vk-num" type="number" min="1" max="16" placeholder="bits" />
<input id="tts-crunch-rate" class="input vk-num" type="number" min="4000" max="48000" step="250" placeholder="Hz" />
<span class="vk-micro-label">bits</span>
<input id="tts-crunch-bits" class="input vk-num" type="number" min="1" max="16" />
<span class="vk-micro-label">Hz</span>
<input id="tts-crunch-rate" class="input vk-num" type="number" min="4000" max="48000" step="250" />
</div>
<div class="vk-profile-row">
<label class="vk-tts-check"><input id="tts-words" type="checkbox" /> word mode</label>
<span class="vk-micro-label">gap</span>
<input id="tts-word-gap" type="range" min="0" max="500" step="10" value="120" />
<span id="tts-word-gap-value" class="vk-mono vk-dim">120ms</span>
</div>
<div class="vk-profile-row">
<span class="vk-micro-label">preset</span>
<select id="tts-preset" class="input">
<option value="">factory</option>
<option value="vox">VOX (Black Mesa)</option>
<option value="hev">HEV suit</option>
</select>
<span class="vk-mono vk-dim">Keith Bell</span>
</div>
<div class="vk-profile-row">
<label class="vk-tts-check">
<input id="tts-vox" type="checkbox" /> VOX prosody
<span
class="vk-info"
title="NetTTS-style Black Mesa delivery for the Flextalk voices: sentence breaks, lead-ins, weighted pauses, and vendor tags. Needs python3. Overrides word mode."
>i</span
>
<label class="vk-tts-check" title="Write the WAV as words are synthesized so playback starts on the first word. Skips the loudness measurement.">
<input id="tts-stream-words" type="checkbox" /> stream word mode
</label>
</div>
<div class="vk-profile-row" id="tts-vox-options" hidden>
<span class="vk-micro-label">VOX prosody</span>
<span class="vk-mono vk-dim">included with this voice</span>
<label class="vk-tts-check">
<input id="tts-vox-clean" type="checkbox" /> clean (no stutter)
</label>
<label class="vk-tts-check" title="Write the WAV as words are synthesized so playback starts on the first word. Skips the loudness measurement; set a fixed gain below if needed.">
<input id="tts-stream-words" type="checkbox" /> stream word mode
</label>
</div>
</section>
<section class="vk-profile-section">