yuyinshibie.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:Daily-code 作者: rui7157 项目源码 文件源码
def __call__(self):
        access_token=json.loads(requests.post("https://openapi.baidu.com/oauth/2.0/token",data=self.key).content).get("access_token")

        c=open("c.txt","a+")
        with open("test1.mp3","rb") as f:
            base64.encode(f,c)  
        vdata=c.read()
        c.close()
        data={
            "format":"wav",
            "rate":8000,
            "channel":1,
            "token":access_token.encode('utf-8'),
            "cuid":"rui7157",
            "len":4096,
            "speech":vdata,
        }
        print data
        result=requests.post("http://vop.baidu.com/server_api",data=data).content
        print result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号