Add crunch presets, echo options, and streaming word mode

This commit is contained in:
Fisto
2026-09-21 12:31:43 +02:00
parent bbb580deea
commit c66d00ee59
11 changed files with 371 additions and 17 deletions
+23 -1
View File
@@ -2025,6 +2025,12 @@ function fillProfileControls() {
const echo = Number(state.speech.echo);
$("#tts-echo").value = Number.isFinite(echo) && state.speech.echo !== null ? echo : 0;
$("#tts-echo-value").textContent = Number($("#tts-echo").value) > 0 ? $("#tts-echo").value : "off";
$("#tts-echo-delay").value = state.speech.echoDelayMs ?? "";
$("#tts-echo-level").value = state.speech.echoLevel ?? "";
$("#tts-crunch").value = state.speech.crunch ?? "";
$("#tts-crunch-bits").value = state.speech.crunchBits ?? "";
$("#tts-crunch-rate").value = state.speech.crunchRate ?? "";
$("#tts-stream-words").checked = state.speech.streamWords !== false;
$("#tts-words").checked = state.speech.words === true;
$("#tts-preset").value = state.speech.preset ?? "";
@@ -2065,7 +2071,13 @@ function effectOptions() {
wordGapMs: Number($("#tts-word-gap").value),
vox: $("#tts-vox").checked,
voxClean: $("#tts-vox-clean").checked,
preset: $("#tts-preset").value || null
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,
crunchBits: $("#tts-crunch-bits").value ? Number($("#tts-crunch-bits").value) : null,
crunchRate: $("#tts-crunch-rate").value ? Number($("#tts-crunch-rate").value) : null,
streamWords: $("#tts-stream-words").checked
};
}
function syncVoiceControls(voices, selected) {
@@ -2755,6 +2767,16 @@ function init() {
void saveSpeech();
});
$("#tts-vox-clean").addEventListener("change", () => void saveSpeech());
for (const id of [
"#tts-echo-delay",
"#tts-echo-level",
"#tts-crunch",
"#tts-crunch-bits",
"#tts-crunch-rate",
"#tts-stream-words"
]) {
$(id).addEventListener("change", () => void saveSpeech());
}
$("#profile-open").addEventListener("click", () => {
const panel = document.querySelector(".vk-profile-panel");
if (panel) {
+18
View File
@@ -550,6 +550,21 @@
<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" />
</div>
<div class="vk-profile-row">
<span class="vk-micro-label">crunch</span>
<select id="tts-crunch" class="input">
<option value="">off</option>
<option value="hl90">HL90 · 8-bit 11 kHz</option>
<option value="hl90hq">HL90 HQ · 8-bit 22 kHz</option>
<option value="telephone">telephone · 8 kHz</option>
<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" />
</div>
<div class="vk-profile-row">
<label class="vk-tts-check"><input id="tts-words" type="checkbox" /> word mode</label>
@@ -577,6 +592,9 @@
<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">