refactor: Update TTS function to handle auto audio path

This commit is contained in:
Junha Heo
2024-08-25 21:02:37 +09:00
parent bcb352942e
commit c5bd829aff

View File

@@ -1181,7 +1181,9 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
db.characters[selectedChar].chats[selectedChat] = currentChat db.characters[selectedChar].chats[selectedChat] = currentChat
setDatabase(db) setDatabase(db)
} }
await sayTTS(currentChar, result) if(db.ttsAutoSpeech){
await sayTTS(currentChar, result)
}
} }
else{ else{
const msgs = (req.type === 'success') ? [['char',req.result]] as const const msgs = (req.type === 'success') ? [['char',req.result]] as const
@@ -1240,7 +1242,9 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
mrerolls.push(result) mrerolls.push(result)
} }
db.characters[selectedChar].reloadKeys += 1 db.characters[selectedChar].reloadKeys += 1
await sayTTS(currentChar, result) if(db.ttsAutoSpeech){
await sayTTS(currentChar, result)
}
setDatabase(db) setDatabase(db)
} }