private _recorderConfig = {
duration: 10000,
format: 'mp3',
sampleRate: 8000,
encodeBitRate: 48000,
numberOfChannels: 1,
}
onLoad() {
this._recorderManager = wx.getRecorderManager();
this._recorderManager.onStop((res)=>{
let _innerAudioContext = wx.createInnerAudioContext({'useWebAudioImplement': true});
_innerAudioContext.src = res.tempFilePath;
_innerAudioContext.play();
})
}
// 调用录音
startRecord(){
this._recorderManager.start(this._recorderConfig);
}
// 后续代码省略。。。