#!/usr/bin/env python
# -*- coding:utf-8 -*-
import hashlib
import requests
import hmac
import base64
import datetime
import tempfile
import shutil,os
class aliyun:
def __init__(self):
self.__aliyun_id = "" # 个人用户 id
self.__aliyun_secret = "" # 个人用户 secret
def __time(self):
time = datetime.datetime.strftime(datetime.datetime.utcnow(), "%a, %d %b %Y %H:%M:%S GMT")
return date
def __md5_base64(self, body):
hash = hashlib.md5()
hash.update(body)
str_hex = hash.digest()
return base64.b64encode(str_hex)
def __sha1_base64(self, str_to_sign, secret):
hmacsha1 = hmac.new(secret.encode('utf-8'), str_to_sign.encode('utf-8'), hashlib.sha1)
python 调用阿里云语音合成TTS
最新推荐文章于 2025-10-11 14:36:45 发布

最低0.47元/天 解锁文章
1755





