· 6 years ago · Sep 08, 2019, 12:22 PM
1from aip import AipSpeech
2appID = "17023346"
3apiKey = "yYQiBTaaEGG1VweLmq5kviLL"
4secretKey = "U6mkMrSMsNeN9RmqwLumGffmGLj0KLBz"
5
6client = AipSpeech(appID,apiKey,secretKey)
7result = client.synthesis("这是一段合成的文字","zh","1",{
8"vol":5,
9"spd":3,
10"pit":9,
11"pre":q
12})
13with open("speech.mp3","wb")as f:
14 f.write(result)