+ if (this.rvcVoices) {
+ for (let rvccharvoice of this.rvcVoices) {
+ html += ``;
+ }
+ }
+ html += `
+ if (this.rvcVoices) {
+ for (let rvcnarrvoice of this.rvcVoices) {
+ html += ``;
+ }
+ }
+ html += `
+
+
+
+
+
+
+
+
+
@@ -201,7 +224,7 @@ html += `
async loadSettings(settings) {
updateStatus('Offline');
-
+
if (Object.keys(settings).length === 0) {
console.info('Using default AllTalk TTS Provider settings');
} else {
@@ -214,7 +237,7 @@ html += `
}
}
}
-
+
// Update UI elements to reflect the loaded settings
$('#at_server').val(this.settings.provider_endpoint);
$('#language_options').val(this.settings.language);
@@ -224,7 +247,9 @@ html += `
$('#narrator_voice').val(this.settings.narrator_voice_gen);
$('#rvc_character_voice').val(this.settings.rvc_character_voice);
$('#rvc_narrator_voice').val(this.settings.rvc_narrator_voice);
-
+ $('#rvc_character_pitch').val(this.settings.rvc_character_pitch);
+ $('#rvc_narrator_pitch').val(this.settings.rvc_narrator_pitch);
+
console.debug('AllTalkTTS: Settings loaded');
try {
// Check if TTS provider is ready
@@ -242,7 +267,7 @@ html += `
updateStatus('Offline');
}
}
-
+
applySettingsToHTML() {
const narratorVoiceSelect = document.getElementById('narrator_voice');
@@ -381,9 +406,9 @@ html += `
throw error;
}
}
-
-
-
+
+
+
//##########################################//
// Get Current AT Server Config & Update ST //
//##########################################//
@@ -396,7 +421,7 @@ html += `
}
const currentSettings = await response.json();
currentSettings.models_available.sort((a, b) => a.name.localeCompare(b.name));
-
+
this.settings.enginesAvailable = currentSettings.engines_available;
this.settings.currentEngineLoaded = currentSettings.current_engine_loaded;
this.settings.modelsAvailable = currentSettings.models_available;
@@ -406,9 +431,9 @@ html += `
this.settings.deepspeed_enabled = currentSettings.deepspeed_enabled;
this.settings.lowvram_capable = currentSettings.lowvram_capable;
this.settings.lowvram_enabled = currentSettings.lowvram_enabled;
-
+
await this.fetchRvcVoiceObjects(); // Fetch RVC voices
-
+
this.updateModelDropdown();
this.updateCheckboxes();
this.updateRvcVoiceDropdowns(); // Update the RVC voice dropdowns
@@ -416,7 +441,7 @@ html += `
console.error(`Error updating settings from server: ${error}`);
}
}
-
+
updateRvcVoiceDropdowns() {
const rvcCharacterVoiceSelect = document.getElementById('rvc_character_voice');
const rvcNarratorVoiceSelect = document.getElementById('rvc_narrator_voice');
@@ -581,7 +606,7 @@ html += `
this.onSettingsChange(); // Save the settings after change
});
}
-
+
const rvcNarratorVoiceSelect = document.getElementById('rvc_narrator_voice');
if (rvcNarratorVoiceSelect) {
rvcNarratorVoiceSelect.addEventListener('change', (event) => {
@@ -590,6 +615,22 @@ html += `
});
}
+ const rvcCharacterPitchSelect = document.getElementById('rvc_character_pitch');
+ if (rvcCharacterPitchSelect) {
+ rvcCharacterPitchSelect.addEventListener('change', (event) => {
+ this.settings.rvc_character_pitch = event.target.value;
+ this.onSettingsChange(); // Save the settings after change
+ });
+ }
+
+ const rvcNarratorPitchSelect = document.getElementById('rvc_narrator_pitch');
+ if (rvcNarratorPitchSelect) {
+ rvcNarratorPitchSelect.addEventListener('change', (event) => {
+ this.settings.rvc_narrator_pitch = event.target.value;
+ this.onSettingsChange(); // Save the settings after change
+ });
+ }
+
const debouncedModelSelectChange = (event) => {
clearTimeout(debounceTimeout);
debounceTimeout = setTimeout(() => {
@@ -694,21 +735,21 @@ html += `
const ttsPassAsterisksCheckbox = document.getElementById('tts_pass_asterisks');
const ttsNarrateQuotedCheckbox = document.getElementById('tts_narrate_quoted');
const ttsNarrateDialoguesCheckbox = document.getElementById('tts_narrate_dialogues');
-
+
if (atNarratorSelect && textNotInsideSelect && narratorVoiceSelect) {
atNarratorSelect.addEventListener('change', (event) => {
const narratorOption = event.target.value;
this.settings.narrator_enabled = narratorOption;
-
+
// Check if narrator is disabled
const isNarratorDisabled = narratorOption === 'false';
textNotInsideSelect.disabled = isNarratorDisabled;
narratorVoiceSelect.disabled = isNarratorDisabled;
-
+
console.log(`Narrator option: ${narratorOption}`);
console.log(`textNotInsideSelect disabled: ${textNotInsideSelect.disabled}`);
console.log(`narratorVoiceSelect disabled: ${narratorVoiceSelect.disabled}`);
-
+
if (narratorOption === 'true') {
ttsPassAsterisksCheckbox.checked = false;
$('#tts_pass_asterisks').click();
@@ -728,11 +769,11 @@ html += `
$('#tts_pass_asterisks').click();
$('#tts_pass_asterisks').trigger('change');
}
-
+
this.onSettingsChange();
});
}
-
+
// Event Listener for AT Generation Method Dropdown
const atGenerationMethodSelect = document.getElementById('at_generation_method');
@@ -790,6 +831,8 @@ html += `
this.settings.at_narrator_text_not_inside = $('#at_narrator_text_not_inside').val();
this.settings.rvc_character_voice = $('#rvc_character_voice').val();
this.settings.rvc_narrator_voice = $('#rvc_narrator_voice').val();
+ this.settings.rvc_character_pitch = $('#rvc_character_pitch').val();
+ this.settings.rvc_narrator_pitch = $('#rvc_narrator_pitch').val();
this.settings.narrator_voice_gen = $('#narrator_voice').val();
// Save the updated settings
saveTtsProviderSettings();
@@ -913,9 +956,11 @@ html += `
'text_filtering': "standard",
'character_voice_gen': voiceId,
'rvccharacter_voice_gen': this.settings.rvccharacter_voice_gen || "Disabled",
+ 'rvccharacter_pitch': this.settings.rvc_character_pitch || "0",
'narrator_enabled': this.settings.narrator_enabled,
'narrator_voice_gen': this.settings.narrator_voice_gen,
'rvcnarrator_voice_gen': this.settings.rvcnarrator_voice_gen || "Disabled",
+ 'rvcnarrator_pitch': this.settings.rvc_narrator_pitch || "0",
'text_not_inside': this.settings.at_narrator_text_not_inside,
'language': this.settings.language,
'output_file_name': "st_output",