Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

获取超过60Kb的语音会丢失部分语音内容 #15

Open
binsee opened this issue May 4, 2018 · 4 comments
Open

获取超过60Kb的语音会丢失部分语音内容 #15

binsee opened this issue May 4, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@binsee
Copy link
Owner

binsee commented May 4, 2018

经过测试,发现如下BUG:

getMsgVoice接口:超过60Kb的语音数据,只能拉取到60Kb,也就是说大约36~40秒以上的语音会丢失后边部分语音内容

参考:4882082

60Kb的语音数据,大约是36-45秒以上(不同语音内容压缩比率不同,数据尺寸与长度(秒)的比率大约在1.25-1.4左右)

@binsee binsee added the bug Something isn't working label May 4, 2018
@binsee
Copy link
Owner Author

binsee commented May 4, 2018

推送的语音消息xml结构中,有两个关键字段length和voicelength。前者是语音silk数据尺寸,后者是语音时间长度(ms)。

当语音数据大于30Kb时,不会在推送中拉取原始语音数据,需要单独调用getMsgVoice接口拉取原始语音数据。
但是这个接口最大拉取的数据尺寸为60Kb(或许是缓冲区限制成了60Kb),因此大于60Kb的语音数据,会丢失后半截数据,导致语音不全。

测试日志如下:

[2018-05-04T05:21:09.944] [INFO] app - 收到来自 xxx 的语言消息,包含语音数据:false,xml内容:
<msg><voicemsg endflag="1" length="67477" voicelength="51082" 
clientmsgid="41303661643266363035303230666500170520050418118008bb482106" fromusername="xxx" 
downcount="0" cancelflag="0" voiceformat="4" forwardflag="0" bufid="4758129297832935771" /></msg>
[2018-05-04T05:21:10.256] [INFO] app - 获取消息原始语音结果:true, 获得语音base64尺寸:81920
[2018-05-04T05:21:10.257] [INFO] app - 语音数据语音秒数:51082 ms,xml尺寸:67477,拉取到数据尺寸:61440
[2018-05-04T05:21:10.257] [INFO] app - 语音数据base64尺寸:81920
[2018-05-04T05:21:10.777] [INFO] app - 转发语音信息给 xxx 结果: { success: true,
  data:
   { data: 28672,
     message: '',
     size: 32768,
     status: 0,
     msgId: '3394784151670386104' } }


[2018-05-04T05:21:09.944] [INFO] app - 收到来自 xxx 的语言消息,包含语音数据:false,xml内容:
<msg><voicemsg endflag="1" length="67477" voicelength="51082" 
clientmsgid="41303661643266363035303230666500170520050418118008bb482106" fromusername="xxx" 
downcount="0" cancelflag="0" voiceformat="4" forwardflag="0" bufid="4758129297832935771" /></msg>
[2018-05-04T05:21:10.256] [INFO] app - 获取消息原始语音结果:true, 获得语音base64尺寸:81920
[2018-05-04T05:21:10.257] [INFO] app - 语音数据语音秒数:51082 ms,xml尺寸:67477,拉取到数据尺寸:61440
[2018-05-04T05:21:10.257] [INFO] app - 语音数据base64尺寸:81920
[2018-05-04T05:21:10.777] [INFO] app - 转发语音信息给 xxx 结果: { success: true,
  data: 
   { data: 28672,
     message: '',
     size: 32768,
     status: 0,
     msgId: '3394784151670386104' } }

@wolf8210137
Copy link

试着增加服务器缓存试试

@binsee
Copy link
Owner Author

binsee commented May 4, 2018

并不是服务器缓存问题,是目前协议内部的一个小bug

@wuying8
Copy link

wuying8 commented Jul 25, 2018

这个BUG目前有解决的方案么?是否能在getMsgVoice方法中获取压缩比率的语音数据

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants