fix sbvits2 auto splitting by backup/restore
This commit is contained in:
parent
4e447a59b5
commit
593f9b5832
|
@ -19,6 +19,8 @@ class SBVits2TtsProvider {
|
||||||
* @returns {string} Processed text
|
* @returns {string} Processed text
|
||||||
*/
|
*/
|
||||||
processText(text) {
|
processText(text) {
|
||||||
|
// backup for auto_split
|
||||||
|
text = text.replace(/\n+/g, '<br>');
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,11 +278,8 @@ class SBVits2TtsProvider {
|
||||||
|
|
||||||
const [model_id, speaker_id, style] = voiceId.split('-');
|
const [model_id, speaker_id, style] = voiceId.split('-');
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
if (this.settings.auto_split) {
|
// restore for auto_split
|
||||||
// newlines are replaced with spaces
|
inputText = inputText.replaceAll('<br>', '\n');
|
||||||
// so, revert for auto_split
|
|
||||||
inputText = inputText.replace(' ', '\n');
|
|
||||||
}
|
|
||||||
params.append('text', inputText);
|
params.append('text', inputText);
|
||||||
params.append('model_id', model_id);
|
params.append('model_id', model_id);
|
||||||
params.append('speaker_id', speaker_id);
|
params.append('speaker_id', speaker_id);
|
||||||
|
|
Loading…
Reference in New Issue