修复:语音模式下转文本模式的错误

This commit is contained in:
ifeif 2023-05-16 14:15:41 +08:00
parent 4f44094794
commit 05732f87f2

View file

@ -1156,8 +1156,9 @@ export class chatgpt extends plugin {
this.reply(`建议的回复:\n${chatMessage.suggestedResponses}`)
}
}
if(ttsResponse.length <= Config.ttsAutoFallbackThreshold) {
let wav
if (Config.ttsMode === 'vits-uma-genshin-honkai' && Config.ttsSpace && ttsResponse.length <= Config.ttsAutoFallbackThreshold) {
if (Config.ttsMode === 'vits-uma-genshin-honkai' && Config.ttsSpace) {
if (Config.autoJapanese && (_.isEmpty(Config.baiduTranslateAppId) || _.isEmpty(Config.baiduTranslateSecret))) {
await this.reply('请检查翻译配置是否正确。')
return false
@ -1193,7 +1194,7 @@ export class chatgpt extends plugin {
wav = await VoiceVoxTTS.generateAudio(ttsResponse, {
speaker
})
} else if (!Config.ttsSpace && !Config.azureTTSKey && !Config.voicevoxSpace) {
} else {
await this.reply('你没有配置转语音API哦')
}
try {
@ -1221,6 +1222,7 @@ export class chatgpt extends plugin {
logger.warn(err)
}
}
}
} else if (userSetting.usePicture || (Config.autoUsePicture && response.length > Config.autoUsePictureThreshold)) {
// todo use next api of chatgpt to complete incomplete respoonse
try {