mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-10 00:50:43 +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
|
// Collapse newlines and spaces into single space
|
||||||
text = text.replace(/\s+/g, ' ');
|
text = text.replace(/\s+/g, ' ').trim();
|
||||||
|
|
||||||
console.log(`TTS: ${text}`)
|
console.log(`TTS: ${text}`)
|
||||||
const char = currentTtsJob.name
|
const char = currentTtsJob.name
|
||||||
|
@ -20,10 +20,12 @@ class XTTSTtsProvider {
|
|||||||
*/
|
*/
|
||||||
processText(text) {
|
processText(text) {
|
||||||
// Replace fancy ellipsis with "..."
|
// Replace fancy ellipsis with "..."
|
||||||
text = text.replace(/…/g, '...')
|
text = text.replace(/…/g, '...');
|
||||||
|
// Remove quotes
|
||||||
|
text = text.replace(/["“”‘’]/g, '');
|
||||||
// Replace multiple "." with single "."
|
// Replace multiple "." with single "."
|
||||||
text = text.replace(/\.+/g, '.')
|
text = text.replace(/\.+/g, '.');
|
||||||
return text
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
languageLabels = {
|
languageLabels = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user