百度雲開放語音API 智能語音demo

前置條件“:
1.要在百度雲創建對應的應用
2.python要安裝對應api  pip install baidu-api

from aip import AipSpeech
AppID='19252021'  #百度雲中應用的AppID
APIKey='HYzgPp9tilWzSWa9zkPoW6Ui' #百度雲中應用的APIKey
SecretKe='xaoM9A5acYq5ZzNtv1lIgbzUf1V9hdaL' #百度雲中應用的SecretKe

client=AipSpeech(AppID,APIKey,SecretKe)
res=client.synthesis('你好人工智能','zh',1)
print(res)
with open('Aduo.mp3','wb')as f:
 f.write(res)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章