WeChat アプレット開発ドキュメント
/ 微信小程序API 錄音
微信小程序API 錄音
wx.startRecord(OBJECT)
開始錄音。當(dāng)主動調(diào)用wx.stopRecord,或者錄音超過1分鐘時自動結(jié)束錄音,返回錄音文件的臨時文件路徑
OBJECT參數(shù)說明:
wx.stopRecord()
主動調(diào)用停止錄音。
示例代碼:
wx.starRecord({ success:function(res){ var tempFilePath = res.tempFilePath; }, fail:function(res){ //錄音失敗 } }); setTimeout(function(){ //結(jié)束錄音 wx.stopRecord(); },10000);