Files
chongming-core/test/test_ip_sound_column.py
T

30 lines
976 B
Python
Raw Normal View History

2026-09-04 14:50:34 +08:00
from chongming_request import Client
import asyncio
import logging
async def test_tts():
async with Client() as client:
try:
result = await client.call(
worker_type="ip_sound_column",
subject="ip_sound_column.tts",
method="POST",
payload={
"command": "play_local_tts",
"volume": 5,
"play_count": 1,
"queue": False,
"sync_response": True,
"play_interval": 3,
"tts_pitch": 50,
"tts_speed": 50,
"tts_voice_name": "xiaoyan",
"tts_text": "你好,欢迎使用语音合成服务!",
}
)
print("TTS Response:", result)
except Exception as e:
print("Error during TTS call:", e)
if __name__ == "__main__":
asyncio.run(test_tts())