From 4f906f5e6a7a3712a560f32483bad4975a75a729 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Fri, 1 Dec 2023 00:14:17 +0900 Subject: [PATCH] [fix] novelai fixes by hashcoko --- src/ts/process/tts.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ts/process/tts.ts b/src/ts/process/tts.ts index eb973132..f9c51332 100644 --- a/src/ts/process/tts.ts +++ b/src/ts/process/tts.ts @@ -152,7 +152,13 @@ export async function sayTTS(character:character,text:string) { if(text === ''){ break; } - const response = await globalFetch(`https://api.novelai.net/ai/generate-voice?text=${text}&voice=-1&seed=${character.naittsConfig.voice}&opus=false&version=${character.naittsConfig.version}`, { + const encodedText = encodeURIComponent(text); + const encodedSeed = encodeURIComponent(character.naittsConfig.voice); + + // 인코딩된 값을 사용하여 URL 생성 + const url = `https://api.novelai.net/ai/generate-voice?text=${encodedText}&voice=-1&seed=${encodedSeed}&opus=false&version=${character.naittsConfig.version}`; + + const response = await globalFetch(url, { method: 'GET', headers: { "Authorization": "Bearer " + db.NAIApiKey,