mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
add ready flag
This commit is contained in:
@ -11,6 +11,7 @@ class EdgeTtsProvider {
|
||||
//########//
|
||||
|
||||
settings
|
||||
ready = false
|
||||
voices = []
|
||||
separator = ' . '
|
||||
audioElement = document.createElement('audio')
|
||||
@ -52,10 +53,27 @@ class EdgeTtsProvider {
|
||||
$('#edge_tts_rate').val(this.settings.rate || 0);
|
||||
$('#edge_tts_rate_output').text(this.settings.rate || 0);
|
||||
|
||||
this.checkReady()
|
||||
|
||||
console.info("Settings loaded")
|
||||
}
|
||||
|
||||
|
||||
// Perform a simple readiness check by trying to fetch voiceIds
|
||||
async checkReady(){
|
||||
try {
|
||||
if (!modules.includes('edge-tts')){
|
||||
this.ready = false
|
||||
return
|
||||
}
|
||||
await this.fetchTtsVoiceIds()
|
||||
this.ready = true
|
||||
|
||||
} catch {
|
||||
this.ready = false
|
||||
}
|
||||
}
|
||||
|
||||
async onApplyClick() {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user