|
我写了一个录音按钮和停止录音按钮,对应代码如下:
Model.prototype.luyinClick = function(event){
voice.startRecord({
//localId : self.fileName,
success: function(res){
alert(JSON.stringify(res));
},
cancel : function() {
alert('用户拒绝授权录音');
},
fail : function(res) {
alert(JSON.stringify(res));
}
})
};
Model.prototype.stopbuttonClick = function(event){
var self = this;
voice.stopRecord({
success : function(res) {
alert("OK:" + JSON.stringify(res.localId));
},
fail : function(res) {
alert(JSON.stringify(res));
}
});
};
点录音,过一段时间点击停止录音,
停止录音调用成功回凋显示:OK:“录音文件路径”
然后调用录音的成功回掉显示:“errMsg”:“startRecord:OK” “filename”:[null]
然后在手机的对应文件夹下也没有发现相应的wav文件
|
|