var app = getApp() let appid = **** let secretid = '***' let secretkey = '****' let openConsole = true let plugin = requirePlugin("QCloudAIVoice") plugin.setQCloudSecret(appid, secretid, secretkey)//连接上腾讯云 const text = "腾讯云基于业界领先技术构建的语音合成系统,具备合成速度快、合成拟真度高、语音自然流畅等特点,能够应用于多种使用场景,让设备和应用轻松发声。" const innerAudioContext = wx.createInnerAudioContext(); //调用播放能力 Page({ hechengbobao(){ //验证腾讯云的 plugin.textToSpeech({ content: text, speed: 0, volume: 10, voiceType: 0, language: 1, projectId: 0, sampleRate: 16000, success: function(data) { let url = data.result.filePath; console.log("TTS success", url) if(url && url.length > 0){ innerAudioContext.autoplay = true; innerAudioContext.src = url; innerAudioContext.onPlay(() => { }); innerAudioContext.onError((res) => { console.log(res.errMsg) }); } }, fail: function(error){ console.log(error); } }) } })
腾讯云智能语音,语音合成一直报错"InvalidParameter"?"InvalidParameter" requestId: "62bd51409b80a45b6a53c5b0" 我看了下好像也不缺参数吧,不知道有没有大佬看一下
2022-06-30