From f4fccf957f45b61e2bfdf62a5a64aa76f81ac520 Mon Sep 17 00:00:00 2001 From: ifeif <36729028+ifeif@users.noreply.github.com> Date: Sat, 9 Dec 2023 22:50:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E5=A4=8D=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E8=BF=87=E9=95=BF=E6=97=B6=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E8=AF=AD=E9=9F=B3=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/chat.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/chat.js b/apps/chat.js index 42e1613..77bc9f4 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -1302,11 +1302,13 @@ export class chatgpt extends plugin { this.reply(`建议的回复:\n${chatMessage.suggestedResponses}`) } } - const sendable = await generateAudio(this.e, ttsResponse, emotion, emotionDegree) - if (sendable) { - await this.reply(sendable) - } else { - await this.reply('合成语音发生错误~') + if(ttsResponse.length <= parseInt(Config.ttsAutoFallbackThreshold)) { + const sendable = await generateAudio(this.e, ttsResponse, emotion, emotionDegree) + if (sendable) { + await this.reply(sendable) + } else { + await this.reply('合成语音发生错误~') + } } } else if (userSetting.usePicture || (Config.autoUsePicture && response.length > Config.autoUsePictureThreshold)) { // todo use next api of chatgpt to complete incomplete respoonse