Skip to content

Commit 97ba087

Browse files
author
jiangtao
committed
add print log
1 parent d1c7cd5 commit 97ba087

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/handle/audioHandle.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ async def startToChat(conn, text):
7878

7979
async def sendAudioMessage(conn, audios, duration, text):
8080
base_delay = conn.tts_duration
81-
81+
base_delay = 1 if len(text) <= 3 else len(text) * 0.2
82+
time.sleep(base_delay) # 在每次发送后引入2秒的延迟
8283
# 发送 tts.start
8384
if text == conn.tts_first_text:
8485
logger.bind(tag=TAG).info(f"发送第一段语音: {text}")
8586
conn.tts_start_speak_time = time.time()
8687

8788
# 发送 sentence_start(每个音频文件之前发送一次)
8889
sentence_task = asyncio.create_task(
89-
schedule_with_interrupt(0, send_tts_message(conn, "sentence_start", text))
90+
schedule_with_interrupt(base_delay, send_tts_message(conn, "sentence_start", text))
9091
)
9192
conn.scheduled_tasks.append(sentence_task)
9293

0 commit comments

Comments
 (0)