Skip to content

Commit 9b025b4

Browse files
author
jiangtao
committed
语音发送新增同步机制
1 parent 7373050 commit 9b025b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/providers/tts/doubao.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ async def text_to_speak(self, text, output_file):
7171
def get_audio_duration(self, file_path):
7272
"""从duration文件中读取音频时长"""
7373
try:
74-
duration_file = file_path + '.duration'
74+
base_path = file_path.rsplit('.opus', 1)[0]
75+
duration_file = base_path + '.duration'
7576
with open(duration_file, "r") as f:
7677
duration = float(f.read().strip()) / 1000 # 转换为秒
7778
return duration

0 commit comments

Comments
 (0)