#988 Experimental fix for 11labs
This commit is contained in:
parent
8470acda41
commit
1da5ea5280
|
@ -1,3 +1,5 @@
|
|||
import { deepClone } from "../../utils.js";
|
||||
|
||||
export { ElevenLabsTtsProvider }
|
||||
|
||||
class ElevenLabsTtsProvider {
|
||||
|
@ -47,13 +49,14 @@ class ElevenLabsTtsProvider {
|
|||
|
||||
loadSettings(settings) {
|
||||
// Pupulate Provider UI given input settings
|
||||
if (Object.keys(settings).length == 0) {
|
||||
if (!settings || Object.keys(settings).length == 0) {
|
||||
console.info("Using default TTS Provider settings")
|
||||
}
|
||||
|
||||
// Only accept keys defined in defaultSettings
|
||||
this.settings = this.defaultSettings
|
||||
this.settings = deepClone(this.defaultSettings);
|
||||
|
||||
if (settings) {
|
||||
for (const key in settings) {
|
||||
if (key in this.settings) {
|
||||
this.settings[key] = settings[key]
|
||||
|
@ -61,6 +64,7 @@ class ElevenLabsTtsProvider {
|
|||
throw `Invalid setting passed to TTS Provider: ${key}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('#elevenlabs_tts_stability').val(this.settings.stability)
|
||||
$('#elevenlabs_tts_similarity_boost').val(this.settings.similarity_boost)
|
||||
|
|
Loading…
Reference in New Issue