# wx.startRecord(Object object)

From base library 1.6.0 Start, this interface stops maintenance, please use wx.getRecorderManager replace

with Promise style call: Supported

User authorization: Need scope.record

Mini Program plugin: Support, need to Mini Program base library version no less than 1.9.6

Start recording. When the active call wx.stopRecord, or automatically stop recording when the recording exceeds 1 minute. This interface cannot be called when the user leaves the Mini Program.

# parameter

# Object object

attribute type Default values Required Introductions
success function no Interface calls the successful callback function
fail function no Interface calls failed callback functions
complete function no Callback function at the end of an interface call (both successful and unsuccessful calls are executed)

# object.success callback

# parameter
# Object res
attribute type Introductions
tempFilePath string Temporary path to recording file (Local path)

# sample code

wx.startRecord({
  success (res) {
    const tempFilePath = res.tempFilePath
  }
})
setTimeout(function () {
  wx.stopRecord() // End recording
}, 10000)