Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过 highway 通道传输语音 #577

Closed
yujincheng08 opened this issue Sep 6, 2020 · 16 comments · Fixed by #917 or #728
Closed

通过 highway 通道传输语音 #577

yujincheng08 opened this issue Sep 6, 2020 · 16 comments · Fixed by #917 or #728
Assignees
Labels
M 优先级: 主要 t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关
Milestone

Comments

@yujincheng08
Copy link

yujincheng08 commented Sep 6, 2020

目前使用MIRAI1.2.2版本,今天测试语音时候,发现语音发送后会被二压。
原始语音数据为6.72KB,链接如下(通过coolq发送,可能会失效,失效看附件):

http://grouptalk.c2c.qq.com/?ver=0&rkey=3062020101045b305902010102010102048287ba7e042439306a335a4c686d426c4f4548336335334b23425659685966634c6f475a5f54315f676302045f54bc20041f0000000866696c6574797065000000013100000005636f64656300000001310400&filetype=1&voice_codec=1

coolq.zip

而经过mirai发送之后,变成了1.35KB,链接如下(可能会失效,失效见附件):

http://grouptalk.c2c.qq.com/?ver=0&rkey=3062020101045b305902010102010102048287ba7e042438306a33444c526d426c4f4548336335703958653048506c5f4b4e59757947674e30327902045f54bd58041f0000000866696c6574797065000000013100000005636f64656300000001300400&filetype=1&voice_codec=0

mirai.zip

原文件的URL中有voice_codec=1,但是后面变成voice_codec=0。并且在PC无法正常播放。
问题与#548 应该是一样的,但是被以编码问题而关闭。我认为这可能是上传时候某些参数不正确导致的,应该是协议问题。

@yujincheng08 yujincheng08 added the t:problem 类型: 不容易归类为特性或 bug 的综合问题 label Sep 6, 2020
@sandtechnology
Copy link
Collaborator

mirai的voice_codec参数是以文件头进行设置的,请确保文件头正确
这两个文件中,coolQ是
�#!SILK_V3
而mirai是
#!AMR
我相信你将酷Q的文件重新上传会得到和酷Q一样的结果

@mzdluo123 mzdluo123 added the z:as-designed 状态: 一个正常的行为 label Sep 6, 2020
@Him188 Him188 added x:question 标签: 需要更多信息 and removed z:as-designed 状态: 一个正常的行为 t:problem 类型: 不容易归类为特性或 bug 的综合问题 labels Sep 6, 2020
@yujincheng08
Copy link
Author

@sandtechnology 实际上我就是用coolq那个文件,通过mirai转发出去的。不知为何会被二压成amr。

@Hieuzest
Copy link
Contributor

Hieuzest commented Sep 10, 2020

经测试,目前似乎并不能发出返回类型为1的语音,应是协议问题

Update:
直接改url倒是可以取到silk,不过这也就说明了发送时被当作amr然后被服务器二压了。
(顺便,如果你转发走的是httpapi的话,我发现我之前写了个bug可能导致url失效。)

@yujincheng08
Copy link
Author

@Hieuzest 我用的是CQHTTP-MIRAI所以可能关系不大。应该还是因为协议问题发送时候被当作AMR二压了

@Hieuzest
Copy link
Contributor

@Hieuzest 我用的是CQHTTP-MIRAI所以可能关系不大。应该还是因为协议问题发送时候被当作AMR二压了

目前只有httpapi是直接转发,CQHM的实现是二次上传的,所以导致你这里的两条url id不同

@yujincheng08
Copy link
Author

@Hieuzest 是这样的。另外我尝试改codec还是一个1.35K的amr

@CL-Jeremy
Copy link

刚才直接发送 silkv3 格式语音,碰到了同样的问题。操作上和 #548 相同,与转码设置无关(将转码的文件转换回去依然正常)
所以如果原因在于目前使用的 QQ for Android 协议的话,可能应该考虑合并这两个 issue(即:非直接转发消息时, silkv3 格式语音会被转码成 amr)

@Hieuzest
Copy link
Contributor

我没有办法测试(找不到能发silk的端)但简单测试转发消息也会
Any plan on this or start a new issue about the real voice sending?

@yujincheng08 yujincheng08 changed the title 群组语音会被二压导致音质过低 群组silk语音会被二压成amr导致音质过低 Sep 20, 2020
@sandtechnology
Copy link
Collaborator

已进行代码检查 传参及检测无问题 应该是协议问题
@yyuueexxiinngg

@Hieuzest
Copy link
Contributor

我测试时是直接把客户端发出来的format=1的Msg转发出去的,结果回来就format=0了

@yujincheng08
Copy link
Author

隔壁gocqhttp好像已经解决这个问题了

@golezi
Copy link

golezi commented Oct 30, 2020

我是在kotlin上直接开发的,在提 #548之前单步调试只能看懂 区分SILK和AMR
后面就不太懂了
转码方法不变,以前用iotqq发送出的语音听起来是正常的,只是在qq上会显示成2秒而不是qq会员长语音
不知道和会员长语音的实现方式是否有关

@yyuueexxiinngg
Copy link
Contributor

此Issue @Mrs4s 或许可以提供些帮助

看了下go-cqhttp的更新, 好像把codec重新填死为0了
Mrs4s/MiraiGo@d3b0f5f

不过当时的讨论是codec填0可以发任何格式的语音, 但会导致PC端无法正常播放. 现在go-cqhttp那边的语音也有点问题
Mrs4s/go-cqhttp#390

目前我手上没有能成功登录的帐号, 暂无法进行测试

@sandtechnology
Copy link
Collaborator

已进行代码检查 传参及检测无问题 应该是协议问题
@yyuueexxiinngg

问题已找到,确实是上传时候某些参数不正确导致的,将会发送PR修复

sandtechnology added a commit to sandtechnology/mirai that referenced this issue Dec 18, 2020
sandtechnology added a commit to sandtechnology/mirai that referenced this issue Dec 18, 2020
@Him188 Him188 linked a pull request Dec 18, 2020 that will close this issue
CL-Jeremy pushed a commit to CL-Jeremy/mirai that referenced this issue Dec 18, 2020
Him188 added a commit that referenced this issue Dec 20, 2020
@Karlatemp Karlatemp reopened this Dec 20, 2020
@Him188
Copy link
Member

Him188 commented Dec 27, 2020

备注:经过讨论确定问题是需要通过 highway 传输语音. 现在使用的 HTTP 接口总是会压缩

@Him188 Him188 added M 优先级: 主要 t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关 unplanned and removed x:question 标签: 需要更多信息 labels Dec 27, 2020
@Him188 Him188 added this to the Backlog milestone Dec 29, 2020
@Him188 Him188 removed the unplanned label Dec 29, 2020
@Him188 Him188 modified the milestones: Backlog, 2.1.0, 2.2.0 Jan 22, 2021
@Him188 Him188 changed the title 群组silk语音会被二压成amr导致音质过低 通过 highway 传输语音 Jan 22, 2021
Him188 added a commit that referenced this issue Jan 22, 2021
@Him188 Him188 changed the title 通过 highway 传输语音 通过 BDH 通道传输语音 Jan 26, 2021
@Him188 Him188 mentioned this issue Jan 26, 2021
@Him188 Him188 changed the title 通过 BDH 通道传输语音 通过 highway 通道传输语音 Jan 26, 2021
@Him188 Him188 self-assigned this Jan 26, 2021
Him188 added a commit that referenced this issue Jan 26, 2021
@Him188
Copy link
Member

Him188 commented Jan 26, 2021

Highway (BDH) 上传已经实现, 现在可以尝试版本 2.2.0-dev-bdh-1

@Him188 Him188 removed a link to a pull request Jan 26, 2021
@Him188 Him188 linked a pull request Jan 26, 2021 that will close this issue
Him188 added a commit that referenced this issue Jan 26, 2021
Add fallback strategies for uploading group voice #577 and private image #916
Him188 added a commit that referenced this issue Jan 26, 2021
- Fix retryWithServers exception suppress
- ConfigPush BDH session
- ConfigPush SSO change server
- Upload group PTT silk, #577
- Support upload private image through highway, close #194;
- Add fallback strategies for uploading group voice #577 and private image #916
- Upload all resources through highway BDH
- Support concurrent uploading
- Add BotConfiguration.highwayUploadCoroutineCount

close #916, close #577, close #194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M 优先级: 主要 t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants