mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Substitute macros in TTS text before narrating
This commit is contained in:
		| @@ -1,4 +1,4 @@ | ||||
| import { callPopup, cancelTtsPlay, eventSource, event_types, name2, saveSettingsDebounced } from '../../../script.js'; | ||||
| import { callPopup, cancelTtsPlay, eventSource, event_types, name2, saveSettingsDebounced, substituteParams } from '../../../script.js'; | ||||
| import { ModuleWorkerWrapper, doExtrasFetch, extension_settings, getApiUrl, getContext, modules } from '../../extensions.js'; | ||||
| import { delay, escapeRegex, getBase64Async, getStringHash, onlyUnique } from '../../utils.js'; | ||||
| import { EdgeTtsProvider } from './edge.js'; | ||||
| @@ -425,6 +425,9 @@ async function processTtsQueue() { | ||||
|     currentTtsJob = ttsJobQueue.shift(); | ||||
|     let text = extension_settings.tts.narrate_translated_only ? (currentTtsJob?.extra?.display_text || currentTtsJob.mes) : currentTtsJob.mes; | ||||
|  | ||||
|     // Substitute macros | ||||
|     text = substituteParams(text); | ||||
|  | ||||
|     if (extension_settings.tts.skip_codeblocks) { | ||||
|         text = text.replace(/^\s{4}.*$/gm, '').trim(); | ||||
|         text = text.replace(/```.*?```/gs, '').trim(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user