[fix] novelai fixes by hashcoko

This commit is contained in:
kwaroran
2023-12-01 00:14:17 +09:00
parent 62a4a76ffb
commit 4f906f5e6a

View File

@@ -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,