Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID ab8bd0e4-b8a6-11eb-a01d-5254002d4a45, cloud function service error code -504002, error message The “original” argument must be of type function
TypeError [ERR_INVALID_ARG_TYPE]: The “original” argument must be of type function
代码如下:本地调试没有问题,上传到云服务运行出错
// 云函数入口文件
const tencentcloud = require(“tencentcloud-sdk-nodejs”);
const TtsClient = tencentcloud.tts.v20190823.Client;
const clientConfig = {
credential: {
secretId: “”,
secretKey: “”
},
region: “ap-shanghai”,
profile: {
httpProfile: {
endpoint: “tts.tencentcloudapi.com”,
},
},
};
exports.VoiceOut = {
async Speak(role,text) {
const client = new TtsClient(clientConfig);
let voiceType,speed,volumn
voiceType = 101008
speed=-0.5
volumn=0.3
const params = {
“Text”: text,
“SessionId”: “abcdef1234567890”,
“ModelType”: 1,
“Speed”: speed,
“VoiceType”: voiceType,
“Volume”: volumn
};
let speak = client.TextToVoice(params)
return speak
}
}