From 0f38e6b9cc93265090ee130470a0f76f881179df Mon Sep 17 00:00:00 2001 From: WJG Date: Wed, 28 Feb 2024 14:44:54 +0800 Subject: [PATCH] misc: set default TTS to xiaoai --- src/services/speaker/base.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/speaker/base.ts b/src/services/speaker/base.ts index 243cb66..4f0db6a 100644 --- a/src/services/speaker/base.ts +++ b/src/services/speaker/base.ts @@ -62,7 +62,7 @@ export class BaseSpeaker { async unWakeUp() { // 通过 TTS 不发音文本,使小爱退出唤醒状态 - await this.MiNA!.pause() + await this.MiNA!.pause(); await this.MiIOT!.doAction(5, 1, kAreYouOK); } @@ -86,6 +86,11 @@ export class BaseSpeaker { tts = this.tts, } = options ?? {}; + const doubaoTTS = process.env.TTS_DOUBAO; + if (!doubaoTTS) { + tts = "xiaoai"; // 没有提供豆包语音接口时,只能使用小爱自带 TTS + } + const ttsNotXiaoai = (!!stream || !!text) && !audio && tts !== "xiaoai"; playSFX = ttsNotXiaoai && playSFX;