raspberry 纳西妲语音
使用 subprocess 播放音频流。"speake": "纳西妲",print("播放完毕")print("请求失败")s = input("输入:")
·
import requests
import subprocess
ur = 'https://api.lolimi.cn/API/yyhc/y.php'
s = input("输入:")
data = {
"msg": s,
"speake": "纳西妲",
"noisew": "0.7",
"sdp": "",
"Length": "1",
"noise": "0.6",
"type": "2",
}
response = requests.get(ur, data)
if response.status_code == 200:
# 使用 subprocess 播放音频流
subprocess.Popen(['mpg321', '-'], stdin=subprocess.PIPE).communicate(response.content)
print("播放完毕")
else:
print("请求失败")
更多推荐
所有评论(0)