HomeDocs
Skip to main content

RecorderManager.stop

Introduction

Stops recording audio.

Usage Restrictions

Supported in the basic library version 4.0.0 or higher.

Parameters

Object object

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function for a successful API invocation.
failfunctionNoCallback function for a failed API invocation.
completefunctionNoCallback function that is called at the end of the API invocation (whether it was successful or failed).

object.success Callback Function Parameters

Object res

PropertyTypeDescription
successstringtrue - Success

object.fail Callback Function Parameters

Object res

PropertyTypeDescription
errMsgstringError message
successstringfalse - Failure

errMsg Description

Error MessageDescription
Audio is stop, don't stop record again : A10012Recording has already stopped; please do not stop again
Audio failed with permission denied : A10011No recording permission

Example

// pages/index/index.js

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

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

In this example, the RecorderManager is used to stop the recording of audio. The stop method is called to stop the recording, and you can handle the success or failure of the operation using the provided callback functions.

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