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

语音消息无法发送 #28

Open
onlyzqy opened this issue Mar 8, 2024 · 6 comments
Open

语音消息无法发送 #28

onlyzqy opened this issue Mar 8, 2024 · 6 comments
Labels
question 对错误或其它问题进行提问 wait-for-reply 信息不足,等待进一步补充信息

Comments

@onlyzqy
Copy link

onlyzqy commented Mar 8, 2024

问题描述

通过overflow和lagrange发送语音消息无法发出

复现

通过overflow和lagrange发送语音消息无法发出

Overflow 版本

8c7dd0c

其他组件版本

No response

系统日志

2024-03-08 23:08:02 W/Onebot: Request failed: [send_group_msg, echo=196] app=Lagrange.OneBot v0.0.3 ,message=, retCode=200, retJson={"status":"failed","retcode":200,"data":null,"echo":196}
2024-03-08 23:08:02 V/Bot.2411510662: Group(937068620) <- [overflow:audio,file=base64:////lcQBTAAAD+M66iEFCEDHR0zPvlSVMi... (about 10.83 KB)]

网络日志

2024-03-08 23:08:02 D/Onebot: Client received <-- {"status":"failed","retcode":200,"data":null,"echo":196}
2024-03-08 23:08:02 W/Onebot: Request failed: [send_group_msg, echo=196] app=Lagrange.OneBot v0.0.3 ,message=, retCode=200, retJson={"status":"failed","retcode":200,"data":null,"echo":196}
2024-03-08 23:08:02 V/Onebot: Stacktrace: 
cn.evolvefield.onebot.client.util.ActionFailedException: app=Lagrange.OneBot v0.0.3 ,message=, retCode=200, retJson={"status":"failed","retcode":200,"data":null,"echo":196}
	at cn.evolvefield.onebot.client.util.ActionSendRequest.send(ActionSendRequest.kt:49)
	at cn.evolvefield.onebot.client.util.ActionSendRequest$send$1.invokeSuspend(ActionSendRequest.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
	at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
	at kotlinx.coroutines.ResumeAwaitOnCompletion.invoke(JobSupport.kt:1413)
	at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:318)
	at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:295)
	at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:856)
	at kotlinx.coroutines.JobSupport.makeCompleting$kotlinx_coroutines_core(JobSupport.kt:806)
	at kotlinx.coroutines.CompletableDeferredImpl.complete(CompletableDeferred.kt:92)
	at cn.evolvefield.onebot.client.util.ActionSendRequest.onCallback(ActionSendRequest.kt:64)
	at cn.evolvefield.onebot.client.handler.ActionHandler.onReceiveActionResp(ActionHandler.kt:38)
	at cn.evolvefield.onebot.client.connection.IAdapter$DefaultImpls.onReceiveMessage(IAdapter.kt:26)
	at cn.evolvefield.onebot.client.connection.WSClient.onReceiveMessage(WSClient.kt:19)
	at cn.evolvefield.onebot.client.connection.WSClient.onMessage(WSClient.kt:45)
	at top.mrxiaom.overflow.internal.deps.websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:636)
	at top.mrxiaom.overflow.internal.deps.websocket.drafts.Draft_6455.processFrameText(Draft_6455.java:986)
	at top.mrxiaom.overflow.internal.deps.websocket.drafts.Draft_6455.processFrame(Draft_6455.java:910)
	at top.mrxiaom.overflow.internal.deps.websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:402)
	at top.mrxiaom.overflow.internal.deps.websocket.WebSocketImpl.decode(WebSocketImpl.java:234)
	at top.mrxiaom.overflow.internal.deps.websocket.client.WebSocketClient.run(WebSocketClient.java:516)
	at java.base/java.lang.Thread.run(Thread.java:833)

补充信息

warn: Lagrange.OneBot.Core.Operation.OperationService[0]
Unexpected error encountered while handling message.
System.Exception: Encode failed
at Lagrange.OneBot.Message.Entity.RecordSegment.Build(MessageBuilder builder, SegmentBase segment)
at Lagrange.OneBot.Core.Operation.Message.MessageCommon.BuildMessages(MessageBuilder builder, List`1 segments)
at Lagrange.OneBot.Core.Operation.Message.SendGroupMessageOperation.HandleOperation(BotContext context, JsonNode payload)
at Lagrange.OneBot.Core.Operation.OperationService.HandleOperation(MsgRecvEventArgs e)

@onlyzqy onlyzqy added the question 对错误或其它问题进行提问 label Mar 8, 2024
@MrXiaoM
Copy link
Owner

MrXiaoM commented Mar 9, 2024

看起来应该是 Lagrange 无法编码语音文件。
不清楚为什么语音链接base64后面是四个斜杠,有可能是这里导致 Lagrange 无法正确解析语音文件。
最新版优化了消息中的链接显示,添加了文件类型识别,可尝试使用最新版看看输出的信息如何

@onlyzqy
Copy link
Author

onlyzqy commented Mar 9, 2024

使用2d54df9新版,语音输出依旧存在问题
Overflow端日志如下:
2024-03-10 00:01:02 W/Onebot: Request failed: [send_group_msg] app=Lagrange.OneBot v0.0.3, message=, retJson={"status":"failed","retcode":200,"data":null,"echo":107}
2024-03-10 00:01:02 V/Bot.2411510662: Group(937068620) <- [overflow:audio,file=base64:////FcQBPiYAFAIoCjVu8AAQA... (about 63.67 KB)]

网络日志如下:
2024-03-10 00:01:02 D/Onebot: Client received <-- {"status":"failed","retcode":200,"data":null,"echo":107}
2024-03-10 00:01:02 W/Onebot: Request failed: [send_group_msg] app=Lagrange.OneBot v0.0.3, message=, retJson={"status":"failed","retcode":200,"data":null,"echo":107}
2024-03-10 00:01:02 V/Onebot: Stacktrace:
cn.evolvefield.onebot.client.util.ActionFailedException: app=Lagrange.OneBot v0.0.3, message=, retJson={"status":"failed","retcode":200,"data":null,"echo":107}
at cn.evolvefield.onebot.client.util.ActionSendRequest.send(ActionSendRequest.kt:68)
at cn.evolvefield.onebot.client.util.ActionSendRequest$send$1.invokeSuspend(ActionSendRequest.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at kotlinx.coroutines.ResumeAwaitOnCompletion.invoke(JobSupport.kt:1413)
at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:318)
at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:295)
at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:856)
at kotlinx.coroutines.JobSupport.makeCompleting$kotlinx_coroutines_core(JobSupport.kt:806)
at kotlinx.coroutines.CompletableDeferredImpl.complete(CompletableDeferred.kt:92)
at cn.evolvefield.onebot.client.util.ActionSendRequest.onCallback(ActionSendRequest.kt:81)
at cn.evolvefield.onebot.client.handler.ActionHandler.onReceiveActionResp(ActionHandler.kt:38)
at cn.evolvefield.onebot.client.connection.IAdapter$DefaultImpls.onReceiveMessage(IAdapter.kt:27)
at cn.evolvefield.onebot.client.connection.WSClient.onReceiveMessage(WSClient.kt:19)
at cn.evolvefield.onebot.client.connection.WSClient.onMessage(WSClient.kt:45)
at top.mrxiaom.overflow.internal.deps.websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:636)
at top.mrxiaom.overflow.internal.deps.websocket.drafts.Draft_6455.processFrameText(Draft_6455.java:986)
at top.mrxiaom.overflow.internal.deps.websocket.drafts.Draft_6455.processFrame(Draft_6455.java:910)
at top.mrxiaom.overflow.internal.deps.websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:402)
at top.mrxiaom.overflow.internal.deps.websocket.WebSocketImpl.decode(WebSocketImpl.java:234)
at top.mrxiaom.overflow.internal.deps.websocket.client.WebSocketClient.run(WebSocketClient.java:516)
at java.base/java.lang.Thread.run(Thread.java:833)

Lagrange端警告日志与之前相同

@MrXiaoM
Copy link
Owner

MrXiaoM commented Mar 9, 2024

待发送的语音是如何生成的,可以发一份样品上来吗

@LancherM
Copy link

我遇到了相似的问题,我的语音生成实现是

byte[] bytes = Files.readAllBytes(Paths.get(path));
String base64 = Base64.getEncoder().encodeToString(bytes);
Audio audio = OverflowAPI.get().audioFromFile("base64://"+ base64);
sender.sendMessage(audio);

网络日志

2024-03-19 23:13:52 W/Onebot: Request failed: [send_group_msg] app=Lagrange.OneBot v0.0.3, message=, retJson={"status":"failed","retcode":200,"data":null,"echo":6}
2024-03-19 23:13:52 V/Bot.xxxxxx: Group(xxxxx) <- [overflow:audio,file=base64://UklGRiR3AQBXQVZFZm10IBA... (webp, about 93.79 KB)]

lagrange端日志

warn: Lagrange.OneBot.Core.Operation.OperationService[0]
      Unexpected error encountered while handling message.
      System.NotImplementedException: The method or operation is not implemented.
         at Lagrange.OneBot.Message.Entity.RecordSegment.ConvertFormat(Byte[] audio, Double& audioTime)
         at Lagrange.OneBot.Message.Entity.RecordSegment.Build(MessageBuilder builder, SegmentBase segment)
         at Lagrange.OneBot.Core.Operation.Message.MessageCommon.BuildMessages(MessageBuilder builder, List`1 segments)
         at Lagrange.OneBot.Core.Operation.Message.MessageCommon.ParseChain(OneBotGroupMessage message)
         at Lagrange.OneBot.Core.Operation.Message.SendGroupMessageOperation.HandleOperation(BotContext context, JsonNode payload)
         at Lagrange.OneBot.Core.Operation.OperationService.HandleOperation(MsgRecvEventArgs e)

@LancherM
Copy link

我遇到了相似的问题,我的语音生成实现是

byte[] bytes = Files.readAllBytes(Paths.get(path));
String base64 = Base64.getEncoder().encodeToString(bytes);
Audio audio = OverflowAPI.get().audioFromFile("base64://"+ base64);
sender.sendMessage(audio);

网络日志

2024-03-19 23:13:52 W/Onebot: Request failed: [send_group_msg] app=Lagrange.OneBot v0.0.3, message=, retJson={"status":"failed","retcode":200,"data":null,"echo":6}
2024-03-19 23:13:52 V/Bot.xxxxxx: Group(xxxxx) <- [overflow:audio,file=base64://UklGRiR3AQBXQVZFZm10IBA... (webp, about 93.79 KB)]

lagrange端日志

warn: Lagrange.OneBot.Core.Operation.OperationService[0]
      Unexpected error encountered while handling message.
      System.NotImplementedException: The method or operation is not implemented.
         at Lagrange.OneBot.Message.Entity.RecordSegment.ConvertFormat(Byte[] audio, Double& audioTime)
         at Lagrange.OneBot.Message.Entity.RecordSegment.Build(MessageBuilder builder, SegmentBase segment)
         at Lagrange.OneBot.Core.Operation.Message.MessageCommon.BuildMessages(MessageBuilder builder, List`1 segments)
         at Lagrange.OneBot.Core.Operation.Message.MessageCommon.ParseChain(OneBotGroupMessage message)
         at Lagrange.OneBot.Core.Operation.Message.SendGroupMessageOperation.HandleOperation(BotContext context, JsonNode payload)
         at Lagrange.OneBot.Core.Operation.OperationService.HandleOperation(MsgRecvEventArgs e)

看起来好像必须是silk格式,换成silk格式就能正常发送了

@MrXiaoM MrXiaoM added the wait-for-reply 信息不足,等待进一步补充信息 label Apr 20, 2024
@cdc12345
Copy link

不知道能不能让Overflow支持转换音频格式(

MrXiaoM added a commit that referenced this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question 对错误或其它问题进行提问 wait-for-reply 信息不足,等待进一步补充信息
Projects
None yet
Development

No branches or pull requests

4 participants