帖子
帖子
用户
博客
课程
显示全部楼层
3
帖子
0
勋章
15
Y币

[BUG] stopRecord录音路径问题

[复制链接]
发表于 2017-7-26 17:29:54
本帖最后由 cs排骨 于 2017-7-26 17:54 编辑

安卓模拟器 测试 没问题   安卓真机出现以下问题


配合UIChatBox使用时,按钮按1秒以上没问题,stopRecord返回路径   duration  没问题
测试时不长按  只做点击(录音按钮)  出现问题    stopRecord方法  返回的路径  duration  固定出现(是之前出现过的)







        uiChatBox.addEventListener({
                                target : 'recordBtn',
                                name : 'press'
                        }, function(ret, err) {
                                // 录用保存目录
                                var savePath = api.cacheDir + "/";
                                // 录音保存文件名
                                var saveName =Math.random() + ".amr";
                                // 开始录音
                                api.startRecord({
                                        path : savePath + saveName
                                });
                        });
                        uiChatBox.addEventListener({
                                target : 'recordBtn',
                                name : 'press_cancel'
                        }, function(ret, err) {
                                // 停止录音
                                api.stopRecord(function(ret, err) {
                                       
                                        if (ret) {
                                                api.toast({
                                msg:ret.duration+ret.path
                        });
                                                
                                        }
                                });
                        });

380
帖子
4
勋章
6
Y币
不长按,不会开始录音吧
3
帖子
0
勋章
15
Y币
技术支持-F 发表于 2017-7-26 21:03
不长按,不会开始录音吧

不长按 做点击    会出现录音文件  stopRecord返回正常参数
然后再次录音的话 stopRecord返回的参数就固定不变了

需要重启启动页面    才正常 。
380
帖子
4
勋章
6
Y币
cs排骨 发表于 2017-7-27 10:49
不长按 做点击    会出现录音文件  stopRecord返回正常参数
然后再次录音的话 stopRecord返回的参数就固 ...

voiceMsg:{"path":"/storage/emulated/0/UZMap/A6903010123826/fsx/vc_msg_1501160727624.amr","duration":0} at UIChatBox.html : 187
voiceMsg:{"path":"/storage/emulated/0/UZMap/A6903010123826/fsx/vc_msg_1501160735818.amr","duration":0} at UIChatBox.html : 187
voiceMsg:{"path":"/storage/emulated/0/UZMap/A6903010123826/fsx/vc_msg_1501160742092.amr","duration":0} at UIChatBox.html : 187
voiceMsg:{"path":"/storage/emulated/0/UZMap/A6903010123826/fsx/vc_msg_1501160758627.amr","duration":2} at UIChatBox.html : 187
voiceMsg:{"path":"/storage/emulated/0/UZMap/A6903010123826/fsx/vc_msg_1501160765406.amr","duration":0} at UIChatBox.html : 187
voiceMsg:{"path":"/storage/emulated/0/UZMap/A6903010123826/fsx/vc_msg_1501160767554.amr","duration":4} at UIChatBox.html : 187

没有复现你说的情况
3
帖子
0
勋章
15
Y币
本帖最后由 cs排骨 于 2017-7-28 15:17 编辑
技术支持-F 发表于 2017-7-27 21:06
voiceMsg:{"path":"/storage/emulated/0/UZMap/A6903010123826/fsx/vc_msg_1501160727624.amr","duration ...

测试机型  三星 s7 edge   在2次点击事件以后此方法返回参数有误
用华为 手机  测试  返回路径 时间  没问题
您需要登录后才可以回帖 登录

本版积分规则