mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Better sentence separation for TTS
This commit is contained in:
@ -7,6 +7,7 @@ class ElevenLabsTtsProvider {
|
|||||||
|
|
||||||
settings
|
settings
|
||||||
voices = []
|
voices = []
|
||||||
|
separator = ' ... ... ... '
|
||||||
|
|
||||||
get settings() {
|
get settings() {
|
||||||
return this.settings
|
return this.settings
|
||||||
|
@ -247,7 +247,8 @@ async function processTtsQueue() {
|
|||||||
const special_quotes = /[“”]/g; // Extend this regex to include other special quotes
|
const special_quotes = /[“”]/g; // Extend this regex to include other special quotes
|
||||||
text = text.replace(special_quotes, '"');
|
text = text.replace(special_quotes, '"');
|
||||||
const matches = text.match(/".*?"/g); // Matches text inside double quotes, non-greedily
|
const matches = text.match(/".*?"/g); // Matches text inside double quotes, non-greedily
|
||||||
text = matches ? matches.join(' ... ... ... ') : text;
|
const partJoiner = (ttsProvider?.separator || ' ... ');
|
||||||
|
text = matches ? matches.join(partJoiner) : text;
|
||||||
}
|
}
|
||||||
console.log(`TTS: ${text}`)
|
console.log(`TTS: ${text}`)
|
||||||
const char = currentTtsJob.name
|
const char = currentTtsJob.name
|
||||||
|
@ -9,6 +9,7 @@ class SileroTtsProvider {
|
|||||||
|
|
||||||
settings
|
settings
|
||||||
voices = []
|
voices = []
|
||||||
|
separator = ' ... '
|
||||||
|
|
||||||
defaultSettings = {
|
defaultSettings = {
|
||||||
provider_endpoint: "http://localhost:8001/tts",
|
provider_endpoint: "http://localhost:8001/tts",
|
||||||
|
@ -21,6 +21,7 @@ class SystemTtsProvider {
|
|||||||
fallbackPreview = 'Neque porro quisquam est qui dolorem ipsum quia dolor sit amet'
|
fallbackPreview = 'Neque porro quisquam est qui dolorem ipsum quia dolor sit amet'
|
||||||
settings
|
settings
|
||||||
voices = []
|
voices = []
|
||||||
|
separator = ' ... '
|
||||||
|
|
||||||
defaultSettings = {
|
defaultSettings = {
|
||||||
voiceMap: {},
|
voiceMap: {},
|
||||||
|
Reference in New Issue
Block a user