Add crunch presets, echo options, and streaming word mode
This commit is contained in:
+23
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user