mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
Improve XTTS text processing
This commit is contained in:
parent
82b7238b39
commit
f809d80ba2
@ -508,7 +508,7 @@ async function processTtsQueue() {
|
||||
}
|
||||
|
||||
// Collapse newlines and spaces into single space
|
||||
text = text.replace(/\s+/g, ' ');
|
||||
text = text.replace(/\s+/g, ' ').trim();
|
||||
|
||||
console.log(`TTS: ${text}`)
|
||||
const char = currentTtsJob.name
|
||||
|
@ -20,10 +20,12 @@ class XTTSTtsProvider {
|
||||
*/
|
||||
processText(text) {
|
||||
// Replace fancy ellipsis with "..."
|
||||
text = text.replace(/…/g, '...')
|
||||
text = text.replace(/…/g, '...');
|
||||
// Remove quotes
|
||||
text = text.replace(/["“”‘’]/g, '');
|
||||
// Replace multiple "." with single "."
|
||||
text = text.replace(/\.+/g, '.')
|
||||
return text
|
||||
text = text.replace(/\.+/g, '.');
|
||||
return text;
|
||||
}
|
||||
|
||||
languageLabels = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user