This commit is contained in:
2025-08-31 14:27:14 +08:00
parent 448bd5c80e
commit e2e4b40a0c
3 changed files with 11 additions and 42 deletions

View File

@@ -259,35 +259,4 @@ def save_audio_callback(output_dir=None):
print(f"音频片段已保存到: {filepath} ({len(audio_data)} 字节)")
return callback
async def test_pipeline():
"""
测试流式TTS管道
"""
# 创建音频回调函数
audio_handler = save_audio_callback()
# 测试提示
prompt = "请详细解释一下量子力学的基本原理,包括波粒二象性、不确定性原理和薛定谔方程。"
print("开始测试流式TTS管道...")
print(f"测试提示: {prompt}")
print("等待LLM生成文本并转换为语音...")
# 运行管道
await streaming_tts_pipeline(prompt, audio_handler)
print("流式TTS管道测试完成")
def main():
"""
主函数,运行测试
"""
asyncio.run(test_pipeline())
if __name__ == "__main__":
main()
return callback