html52.com
我爱小程序-开发者交流社区

云服务调用时出错信息不知怎么处理?

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

  }

}


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付