import configparser from aip import AipSpeech class (): def __init__(self): target=configparser.ConfigParser() target.read("password.ini") AppID=target.get('我的工单','AppID') APIkey=target.get('我的工单','APIKey') SecretKey=target.get('我的工单','SecretKey') self.client=AipSpeech(AppID,APIkey,SecretKey) def combition_voice(self): result=self.client.synthesis("诺铖,诺铖,我爱你,么么哒,mua","zh",1,{ 'vol':5, 'spd':3, 'pit':4, 'per':5, }) with open("1.mp3",'wb') as f: f.write(result) if __name__=="__main__": baidu=Baidu() baidu.combition_voice()
|
近期评论