HomeDocs
Skip to main content

RecorderManager.onError(function listener)

Introduction​

Listen for recording error events.

Usage Restrictions​

Supported from 4.0.0 or higher version of the basic library.

Parameters​

function listener

Listener function to be added for recording error events.

Parameters​

Object res

AttributeTypeDescription
errMsgstringError message

errMsg Description

Error MessagesDescription
Parameter error: A10001Parameter error
Invalid sampleRate "sampleRate", sampleRate should be one of ${availableSampleRate}: A10002sampleRate is not within the range
Invalid numberOfChannels ${numberOfChannels}, numberOfChannels should be one of ${availableChannels} : A10003numberOfChannels is not within the range
Invalid encodeBitRate "encodeBitRate", encodeBitRate should be greater than $min and less than $max : A10004encodeBitRate is not within the range
Invalid format "format", format should be one of ${availableRecordingFormat} : A10005format is not within the range
Invalid audioSource "audioSource", audioSource should be one of ${availableAudioSources} : A10006audioSource is not within the range
Invalid duration $duration, duration should be between 0 and $maxDuration : A10007duration is not within the range
Audio is recording, don't start record again : A10008Audio is already recording, please do not start again
Audio is paused, pause record fail : A10009Recording has been paused, please do not pause again
create record file is fail : A10010Failed to create record file
Audio failed with permission denied : A10011Audio recording permission denied
Audio is stop, don't stop record again : A10012Audio recording has stopped, please do not stop again

Sample Code​

// pages/index/index.js

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

recorderManager.onError((res) => {
console.log("Error:", res);
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.