RecorderManager.onError
2020-08-26 16:31 更新
解释: 录音错误事件, 会回调错误信息。Web 态说明: Web 态环境不支持录音相关功能,该事件不会触发。
方法参数
Function callback
示例
图片示例
代码示例
Page({
onShow() {
const recorderManager = swan.getRecorderManager();
recorderManager.onError(function(e) {
swan.showModal({
title: 'onError success',
content: JSON.stringify(e)
});
});
const options = {
duration: 10000,
sampleRate: 44100,
numberOfChannels: 1,
encodeBitRate: 96000,
format: 'aac'
};
recorderManager.start(options);
this.recorderManager = recorderManager;
}
});
以上内容是否对您有帮助:
更多建议: