https://github.com/ruo-love/tencentcloud-js-v3,
import { V3, V1 } from "@zrcode/tencentcloud-js-v3";
const { authorization, timestamp, curlcmd } = V3(
{
SECRET_ID: "xxx",
SECRET_KEY: "xxx",
action: "TextToVoice",
host: "tts.tencentcloudapi.com",
service: "tts",
region: "ap-shanghai",
version: "2019-08-23",
ContentType: "application/json",
},
{ Text: "123456899", SessionId: "dsaas51" }
);
console.log("传递配置参数,签名自动生成:", authorization, timestamp, curlcmd);