Dokumentasi pembangunan applet WeChat
/ 微信小程序API 錄音
微信小程序API 錄音
wx.startRecord(OBJECT)
開(kāi)始錄音。當(dāng)主動(dòng)調(diào)用wx.stopRecord,或者錄音超過(guò)1分鐘時(shí)自動(dòng)結(jié)束錄音,返回錄音文件的臨時(shí)文件路徑
OBJECT參數(shù)說(shuō)明:
wx.stopRecord()
主動(dòng)調(diào)用停止錄音。
示例代碼:
wx.starRecord({ success:function(res){ var tempFilePath = res.tempFilePath; }, fail:function(res){ //錄音失敗 } }); setTimeout(function(){ //結(jié)束錄音 wx.stopRecord(); },10000);