Add the VOX prosody preference and panel controls
This commit is contained in:
+13
-1
@@ -2027,6 +2027,10 @@ function fillProfileControls() {
|
||||
$("#tts-echo-value").textContent = Number($("#tts-echo").value) > 0 ? $("#tts-echo").value : "off";
|
||||
|
||||
$("#tts-words").checked = state.speech.words === true;
|
||||
$("#tts-vox").checked = state.speech.vox === true;
|
||||
$("#tts-vox-clean").checked = state.speech.voxClean === true;
|
||||
$("#tts-vox-clean").disabled = state.speech.vox !== true;
|
||||
$("#tts-words").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`;
|
||||
@@ -2058,7 +2062,9 @@ function effectOptions() {
|
||||
highpass: Number($("#tts-highpass").value),
|
||||
echo: Number($("#tts-echo").value),
|
||||
words: $("#tts-words").checked,
|
||||
wordGapMs: Number($("#tts-word-gap").value)
|
||||
wordGapMs: Number($("#tts-word-gap").value),
|
||||
vox: $("#tts-vox").checked,
|
||||
voxClean: $("#tts-vox-clean").checked
|
||||
};
|
||||
}
|
||||
function syncVoiceControls(voices, selected) {
|
||||
@@ -2734,6 +2740,12 @@ function init() {
|
||||
$(`#${id}`).addEventListener("change", () => void saveSpeech());
|
||||
}
|
||||
$("#tts-words").addEventListener("change", () => void saveSpeech());
|
||||
$("#tts-vox").addEventListener("change", () => {
|
||||
$("#tts-vox-clean").disabled = !$("#tts-vox").checked;
|
||||
$("#tts-words").disabled = $("#tts-vox").checked;
|
||||
void saveSpeech();
|
||||
});
|
||||
$("#tts-vox-clean").addEventListener("change", () => void saveSpeech());
|
||||
$("#profile-open").addEventListener("click", () => {
|
||||
const panel = document.querySelector(".vk-profile-panel");
|
||||
if (panel) {
|
||||
|
||||
Reference in New Issue
Block a user