Files
mixly3/boards/default/python_mixpy/examples/人工智能Py/02语音合成-1.py
2024-07-19 10:16:00 +08:00

10 lines
258 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import aip
import os
f = open("audio.mp3", 'wb')
client = aip.AipSpeech("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
f.write(client.synthesis("步行导航开始直行后前方50米右转", options={}))
os.startfile("audio.mp3")