diff --git a/output.wav b/output.wav index 55062fc9..7ee9bafb 100644 Binary files a/output.wav and b/output.wav differ diff --git a/test.py b/test.py index 18e9cf6c..021cd53f 100644 --- a/test.py +++ b/test.py @@ -1,24 +1,40 @@ import requests -# API地址(本地运行时) -url = "http://127.0.0.1:9880" +# API地址(本地运行) +url = "http://127.0.0.1:9880/tts" -# 请求体 +# 请求体(对齐 api_v2.py 的 POST 定义) payload = { - "refer_wav_path": "Arona_Academy_In_2.ogg.wav", # 替换为你的参考音频路径 - "prompt_text": "様々な授業やイベントが準備されているので、ご希望のスケジュールを選んでください!", # 参考音频中的文字 - "prompt_language": "ja", # 语言 - "text": "你好。你好。你好。你好。你好。你好。你好。你好。你好。你好。你好。", - "text_language": "zh" + "ref_audio_path": "Arona_Academy_In_2.ogg.wav", + "prompt_text": "様々な授業やイベントが準備されているので、ご希望のスケジュールを選んでください!", + "prompt_lang": "ja", + "text": "中国大陆一共有31个省份啦!", + "text_lang": "zh", + "top_k": 5, + "top_p": 1.0, + "temperature": 1.0, + "text_split_method": "cut0", + "batch_size": 1, + "batch_threshold": 0.75, + "split_bucket": True, + "speed_factor": 1.0, + "fragment_interval": 0.3, + "seed": -1, + "media_type": "wav", + "streaming_mode": False, + "parallel_infer": True, + "repetition_penalty": 1.35, + "sample_steps": 32, + "super_sampling": False } # 发送 POST 请求 response = requests.post(url, json=payload) -# 检查返回 +# 检查返回并保存音频 if response.status_code == 200: with open("output.wav", "wb") as f: f.write(response.content) - print("生成成功,保存为 output.wav") + print("✅ 生成成功,保存为 output.wav") else: - print(f"生成失败: {response.status_code}, 返回信息: {response.text}") + print(f"❌ 生成失败: {response.status_code}, 返回信息: {response.text}")