Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

询问,语音无法发送问题 #22

Closed
Fahaxikiii opened this issue Dec 8, 2021 · 4 comments
Closed

询问,语音无法发送问题 #22

Fahaxikiii opened this issue Dec 8, 2021 · 4 comments

Comments

@Fahaxikiii
Copy link

这是最后一个问题了QAQ

12-08 19:33:32 [SUCCESS] nonebot | CQHTTP 1975969493 | [message.group.normal]: Message -2092313627 from 3116556127@[群:814476238] "亚托莉|atri"
12-08 19:33:32 [INFO] nonebot | Event will be handled by <Matcher from atri, type=message, priority=0, temp=True>
12-08 19:33:32 [INFO] nonebot | Matcher <Matcher from atri, type=message, priority=0, temp=True> running complete
12-08 19:33:32 [ERROR] nonebot | Running matcher <Matcher from atri, type=message, priority=0, temp=True> failed.
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\takker\bot.py", line 29, in
nonebot.run(app="mp_main:app")
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot_init_.py", line 278, in run
get_driver().run(host, port, *args, **kwargs)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 256, in run
uvicorn.run(
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\uvicorn\main.py", line 447, in run
server.run()
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\uvicorn\server.py", line 68, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\message.py", line 128, in _check_matcher
await _run_matcher(Matcher, bot, event, state)

File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\message.py", line 156, in _run_matcher
await matcher.run(bot, event, state)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\matcher.py", line 597, in run
await handler(self, bot, event, self.state)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\handler.py", line 64, in call
await self.func(
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\matcher.py", line 458, in wrapper
await func_handler(matcher, bot, event, state)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\handler.py", line 64, in call
await self.func(
File "C:\Users\Administrator\Desktop\takker\plugins\atri.py", line 64, in _g
await atri.send(record(voice, "atri"))
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\matcher.py", line 495, in send
return await bot.send(event=event, message=_message, **kwargs)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters\cqhttp\bot.py", line 471, in send
return await self.send_msg(**params)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters\cqhttp\bot.py", line 416, in call_api
return await super().call_api(api, **data)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters_bot.py", line 172, in call_api
raise exception
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters_bot.py", line 155, in call_api
result = await self._call_api(api, **data)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters\cqhttp\bot.py", line 363, in _call_api
return _handle_api_result(await ResultStore.fetch(
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters\cqhttp\bot.py", line 192, in _handle_api_result
raise ActionFailed(**result)
nonebot.adapters.cqhttp.exception.ActionFailed: <ActionFailed data=None, echo={'seq': 23}, msg=SEND_MSG_API_ERROR, retcode=100, status=failed, wording=请参考 go-cqhttp 端输出>

@FYWinds
Copy link
Owner

FYWinds commented Dec 8, 2021

安装并配置ffmpeg到环境变量中
gocq需要ffmpeg将语音转码为silk

@FYWinds FYWinds closed this as completed Dec 8, 2021
@Fahaxikiii
Copy link
Author

安装并配置ffmpeg到环境变量中 gocq需要ffmpeg将语音转码为silk

安装 ffmpeg
为了支持任意格式的语音发送, 你需要安装 ffmpeg 。

#Windows
从 这里 (opens new window)下载 并解压, 并为 bin 这个文件夹添加环境变量。

如果遇到下载速度缓慢的问题可以用 这个源 (opens new window)。

然后在 cmd 输入 (不能使用 powershell)

setx /M PATH "C:\Program Files\ffmpeg\bin;%PATH%"
自行将这个指令中的 C:\Program Files 替换成你的解压目录。

我按照这个方法来的
QQ图片20211208194541

@FYWinds
Copy link
Owner

FYWinds commented Dec 8, 2021

配置完后是否重启过服务器并且重启go-cqhttp?

@Fahaxikiii
Copy link
Author

配置完后是否重启过服务器并且重启go-cqhttp?

啊这,我试试,
01779124

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants