录制声音无法本地播发

发布于 6 年前作者 qiangdeng9363 次浏览最后编辑 6 年前来自 ask

我在小程序中录制了一个声音文件,却无法播放。

录音代码:

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();

0 回复
暂无回复