百度的语音合成返回的MP3语音data怎么播放呢?
wx.request({
url: "https://tsn.baidu.com/text2audio?tex=more&lan=zh&cuid=wh123wh&ctp=1&tok=24***82300",
data: { aue: 3 },
success(res) {
fs.writeFile({
filePath: `${wx.env.USER_DATA_PATH}/lady.mp3`,
data: res.data,
encoding: 'ucs2',
success(ws) {
innerAudioContext.src = `${wx.env.USER_DATA_PATH}/lady.mp3`
innerAudioContext.play()
},
})
},
})
将返回的MP3数据,写入一个临时文件,但是返回的错误提示为Uncaught (in promise) DOMException: Failed to load because no supported source was found.