ht-tts-test.py 600 B

123456789101112131415161718
  1. import requests
  2. import json
  3. headers = {
  4. "Authorization": "84e1df1b61114e75b134b5ec496b8922",
  5. "X-User-ID": "HEQLQR1WgpYtN0SEyKoWBsLiZXX2"
  6. }
  7. postdata={
  8. "voice": "zh-TW-HsiaoChenNeural",
  9. "content": ['集仕多股份有限公司','第二個段落','第二代AI主播測試']
  10. }
  11. #r = requests.post('https://play.ht/api/v1/./convert', headers=headers,data=json.dumps(postdata))
  12. #r = requests.post('https://play.ht/api/v1/./convert', headers=headers,json=postdata)
  13. r = requests.post('https://play.ht/api/v1/convert', headers=headers,json=postdata)
  14. print(r.status_code)
  15. print(r.json())