diff --git a/public/scripts/extensions/tts/edge.js b/public/scripts/extensions/tts/edge.js index eadfd6bee..015509f5c 100644 --- a/public/scripts/extensions/tts/edge.js +++ b/public/scripts/extensions/tts/edge.js @@ -2,7 +2,7 @@ import { getRequestHeaders } from "../../../script.js" import { getApiUrl } from "../../extensions.js" import { doExtrasFetch, modules } from "../../extensions.js" import { getPreviewString } from "./index.js" -import { onTtsProviderSettingsInput } from "./index.js" +import { saveTtsProviderSettings } from "./index.js" export { EdgeTtsProvider } @@ -31,7 +31,7 @@ class EdgeTtsProvider { onSettingsChange() { this.settings.rate = Number($('#edge_tts_rate').val()); $('#edge_tts_rate_output').text(this.settings.rate); - onTtsProviderSettingsInput() + saveTtsProviderSettings() } loadSettings(settings) { @@ -63,10 +63,10 @@ class EdgeTtsProvider { // Perform a simple readiness check by trying to fetch voiceIds async checkReady(){ throwIfModuleMissing() - await this.fetchTtsVoiceIds() + await this.fetchTtsVoiceObjects() } - async onApplyClick() { + async onRefreshClick() { return } @@ -76,7 +76,7 @@ class EdgeTtsProvider { async getVoice(voiceName) { if (this.voices.length == 0) { - this.voices = await this.fetchTtsVoiceIds() + this.voices = await this.fetchTtsVoiceObjects() } const match = this.voices.filter( voice => voice.name == voiceName @@ -95,7 +95,7 @@ class EdgeTtsProvider { //###########// // API CALLS // //###########// - async fetchTtsVoiceIds() { + async fetchTtsVoiceObjects() { throwIfModuleMissing() const url = new URL(getApiUrl()); diff --git a/public/scripts/extensions/tts/elevenlabs.js b/public/scripts/extensions/tts/elevenlabs.js index d282c1512..6397c0f12 100644 --- a/public/scripts/extensions/tts/elevenlabs.js +++ b/public/scripts/extensions/tts/elevenlabs.js @@ -1,4 +1,4 @@ -import { onTtsProviderSettingsInput } from "./index.js" +import { saveTtsProviderSettings } from "./index.js" export { ElevenLabsTtsProvider } class ElevenLabsTtsProvider { @@ -46,7 +46,7 @@ class ElevenLabsTtsProvider { this.settings.stability = $('#elevenlabs_tts_stability').val() this.settings.similarity_boost = $('#elevenlabs_tts_similarity_boost').val() this.settings.multilingual = $('#elevenlabs_tts_multilingual').prop('checked') - onTtsProviderSettingsInput() + saveTtsProviderSettings() } @@ -79,10 +79,10 @@ class ElevenLabsTtsProvider { // Perform a simple readiness check by trying to fetch voiceIds async checkReady(){ - await this.fetchTtsVoiceIds() + await this.fetchTtsVoiceObjects() } - async onApplyClick() { + async onRefreshClick() { } async onConnectClick() { @@ -97,7 +97,7 @@ class ElevenLabsTtsProvider { // Using this call to validate API key this.settings.apiKey = $('#elevenlabs_tts_api_key').val() - await this.fetchTtsVoiceIds().catch(error => { + await this.fetchTtsVoiceObjects().catch(error => { throw `TTS API key validation failed` }) this.settings.apiKey = this.settings.apiKey @@ -111,7 +111,7 @@ class ElevenLabsTtsProvider { async getVoice(voiceName) { if (this.voices.length == 0) { - this.voices = await this.fetchTtsVoiceIds() + this.voices = await this.fetchTtsVoiceObjects() } const match = this.voices.filter( elevenVoice => elevenVoice.name == voiceName @@ -158,7 +158,7 @@ class ElevenLabsTtsProvider { //###########// // API CALLS // //###########// - async fetchTtsVoiceIds() { + async fetchTtsVoiceObjects() { const headers = { 'xi-api-key': this.settings.apiKey } diff --git a/public/scripts/extensions/tts/novel.js b/public/scripts/extensions/tts/novel.js index 5dbde0226..58fd73abc 100644 --- a/public/scripts/extensions/tts/novel.js +++ b/public/scripts/extensions/tts/novel.js @@ -1,6 +1,6 @@ import { getRequestHeaders, callPopup } from "../../../script.js" import { getPreviewString } from "./index.js" -import { onTtsProviderSettingsInput } from "./index.js" +import { initVoiceMap } from "./index.js" export { NovelTtsProvider } @@ -37,15 +37,13 @@ class NovelTtsProvider { return html; } - onSettingsChange() { - onTtsProviderSettingsInput() - } // Add a new Novel custom voice to provider async addCustomVoice(){ const voiceName = await callPopup('