import requests, json

# 用统一的 voice_01 测试
r = requests.post('http://localhost:3000/api/tts/generate', json={
    'text': '春天来了万物复苏阳光温暖地洒在大地上',
    'voiceId': 'voice_01',
    'ttsProvider': 'bailian'
})
d = r.json()
print(f'code={d.get("code")} msg={d.get("message")}')
if d.get('data'):
    print(f'audioId={d["data"].get("audioId")}')
    print(f'audioUrl={d["data"].get("audioUrl","")[:80]}')
else:
    print(f'err={json.dumps(d, ensure_ascii=False)[:300]}')
