录制声音无法本地播发
我在小程序中录制了一个声音文件,却无法播放。
录音代码:
wx.startRecord({
success:function(res){
var tempFilePath=res.tempFilePath;
that.setData({
voicepath: tempFilePath,
voiceIcon:"/images/play.png",
voiceOperator:“playVoice”
})
}
})
播放的代码:
this.audioCtx = wx.createAudioContext(‘myAudio’);
console.log(this.data.voicepath);
this.audioCtx.setSrc(this.data.voicepath);
this.audioCtx.play();