录音接口wx.playVoice,首次播放暂停之后,再次播放无响应
[代码]/**[代码][代码] [代码][代码]* 监测录音播放点击事件[代码][代码] [代码][代码]*/[代码][代码]bindPlayRecordTap() {[代码][代码] [代码][代码]this[代码][代码].data.playing ? [代码][代码]this[代码][代码].pauseVoice1() : [代码][代码]this[代码][代码].playVoice1();[代码][代码]},[代码][代码]/**[代码][代码] [代码][代码]* 播放录音[代码][代码] [代码][代码]*/[代码][代码]playVoice1() {[代码][代码] [代码][代码]console.log([代码][代码]'play voice'[代码][代码]);[代码][代码] [代码][代码]const that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.playVoice({[代码][代码] [代码][代码]filePath: [代码][代码]this[代码][代码].data.recordData,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]that.setData({ playing: [代码][代码]true[代码] [代码]});[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(err) {[代码][代码] [代码][代码]console.log(err);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete(res) {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码]},[代码][代码]/**[代码][代码] [代码][代码]* 暂停录音[代码][代码] [代码][代码]*/[代码][代码]pauseVoice1() {[代码][代码] [代码][代码]console.log([代码][代码]'pause voice'[代码][代码]);[代码][代码] [代码][代码]this[代码][代码].setData({ playing: [代码][代码]false[代码] [代码]});[代码][代码] [代码][代码]wx.pauseVoice();[代码][代码]},[代码] 运行结果如下 [图片] 首次点击播放之后,可以正常播放。播放途中暂停,再次点击播放,wx.playVoice()方法既不正常调用,也不提示错误。 从运行的结果可以看到,首次点击播放之后,wx.playVoice()返回了两次success的结果,不知道是不是因为这个原因引起的问题。 请问这个要如何解决。谢谢。