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
Attribute | Type | Description |
---|---|---|
errMsg | string | Error message |
errMsg Description
Error Messages | Description |
---|---|
Parameter error: A10001 | Parameter error |
Invalid sampleRate "sampleRate", sampleRate should be one of ${availableSampleRate}: A10002 | sampleRate is not within the range |
Invalid numberOfChannels ${numberOfChannels}, numberOfChannels should be one of ${availableChannels} : A10003 | numberOfChannels is not within the range |
Invalid encodeBitRate "encodeBitRate", encodeBitRate should be greater than $min and less than $max : A10004 | encodeBitRate is not within the range |
Invalid format "format", format should be one of ${availableRecordingFormat} : A10005 | format is not within the range |
Invalid audioSource "audioSource", audioSource should be one of ${availableAudioSources} : A10006 | audioSource is not within the range |
Invalid duration $duration, duration should be between 0 and $maxDuration : A10007 | duration is not within the range |
Audio is recording, don't start record again : A10008 | Audio is already recording, please do not start again |
Audio is paused, pause record fail : A10009 | Recording has been paused, please do not pause again |
create record file is fail : A10010 | Failed to create record file |
Audio failed with permission denied : A10011 | Audio recording permission denied |
Audio is stop, don't stop record again : A10012 | Audio 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);
});
},
});