Add provider-specific TTS processing: XTTS - replace ellipsis, Novel - remove tildes.

This commit is contained in:
Cohee
2023-11-27 13:25:49 +02:00
parent edafb8dd13
commit ffc4f22012
4 changed files with 39 additions and 6 deletions

View File

@ -13,6 +13,19 @@ class XTTSTtsProvider {
voices = []
separator = '. '
/**
* Perform any text processing before passing to TTS engine.
* @param {string} text Input text
* @returns {string} Processed text
*/
processText(text) {
// Replace fancy ellipsis with "..."
text = text.replace(/…/g, '...')
// Replace multiple "." with single "."
text = text.replace(/\.+/g, '.')
return text
}
languageLabels = {
"Arabic": "ar",
"Brazilian Portuguese": "pt",