通过wx.startRecord录制的音频,记录下path后,通过wx.playVoice可以播放。
但是,将论文件上传至服务器后,在其他界面下载下来却播放不了,出现如下错误?请问应该如何处理?thanks!
其他界面播放代码如下:
this.audioCtx = wx.createInnerAudioContext();
playRecord: function(t) {
console.log(“playRecord:” +JSON.stringify(t));
const audioSource = ‘http://…’ + t.currentTarget.dataset.src;
console.log(‘audioSource:’ + audioSource);
this.audioCtx.autoplay = true;
this.startTime = 0;
this.audioCtx.src = audioSource;
this.audioCtx.play();
this.audioCtx.onPlay(() => {
console.log(‘开始播放’);
})
this.audioCtx.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
})
},
报如下错误: