button:function(e){ wx.startRecord({ success: function (res) { voice = res.tempFilePath }, fail: function (res) { //錄音失敗 } }) }, stop:function(e){ // setTimeout(function () { //結束錄音 wx.stopRecord() // }, 10000) }, bofang:function(e){ console.log(voice) wx.playVoice({ filePath: voice }) }
