update: 自定义配置输出音频采样率

This commit is contained in:
Sakura-RanChen
2026-01-14 17:54:50 +08:00
parent 0a8121e849
commit fd1dd39463
17 changed files with 129 additions and 82 deletions
@@ -145,7 +145,8 @@ async def wakeupWordsResponse(conn):
# 获取当前音色
voice = getattr(conn.tts, "voice", "default")
wav_bytes = opus_datas_to_wav_bytes(tts_result, sample_rate=16000)
# 使用链接的sample_rate
wav_bytes = opus_datas_to_wav_bytes(tts_result, sample_rate=conn.sample_rate)
file_path = wakeup_words_config.generate_file_path(voice)
with open(file_path, "wb") as f:
f.write(wav_bytes)