RecorderManager.onError
解释: 录音错误事件, 会回调错误信息。Web 态说明: Web 态环境不支持录音相关功能,该事件不会触发。
方法参数
Function callback
示例
在开发者工具中预览效果
扫码体验
请使用百度APP扫码
图片示例
代码示例
在 js 文件中
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; }});
