HomeDocs
Skip to main content

RecorderManager.pause

Introduction

This function is used to pause a recording.

Usage Limitations

Supported in the basic library version 4.0.0 or higher.

Parameters

Object object

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function for a successful interface call
failfunctionNoCallback function for a failed interface call
completefunctionNoCallback function for the end of an interface call (called whether the call is successful or not)

object.success Callback Function

Parameters

Object res

PropertyTypeDescription
successstringtrue - Successful

object.fail Callback Function

Parameters

Object res

PropertyTypeDescription
errMsgstringError message
successstringfalse - Failed

errMsg Explanation

Error MessageDescription
Audio is paused, pause record fail: A10009Recording is already paused.
Audio failed with permission denied: A10011No recording permission.

Example Code

// pages/index/index.js

Page({
pause() {
const recorderManager = dlt.getRecorderManager();

recorderManager.pause({
success: () => {
console.log('Success');
},
});
},
});

In this example, the RecorderManager.pause method is used to pause a recording. It accepts an optional success callback function, which is called upon a successful pause. If there are any errors, a failure callback is called, and the error message provides details about the error, such as whether the recording is already paused or if there is no recording permission.

Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.