Skip to content

[Bug]v4.22.1后 Whisper (API) 无法被正常调用 STT失效 #7461

@200303

Description

@200303

What happened / 发生了什么

v4.22.1后 发送语音后不会正常解析成文本

把版本回退到 v4.22.1 和 vv4.22.0后能正常解析

Reproduce / 如何复现?

AstrBot版本 v4.22.2/v4.22.3
STT模型提供商 Whisper(API)
开启STT 选择模型提供商
发送语音后不会正常解析

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

Linux podman

OS

Linux

Logs / 报错日志

AstrBot v4.22.1 正常日志

[2026-04-11 20:23:08.744] [Core] [INFO] [core.event_bus:61]: [default] [ABot(aiocqhttp)] [会话]: [ComponentType.Record]
[2026-04-11 20:23:08.744] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']
[2026-04-11 20:23:08.970] [Core] [INFO] [sources.whisper_api_source:112]: Converting amr file to wav using convert_to_pcm_wav...
[2026-04-11 20:23:08.971] [Core] [DBUG] [utils.tencent_record_helper:73]: pyffmpeg 转换失败: No module named 'pyffmpeg', 尝试使用 ffmpeg 命令行进行转换
[2026-04-11 20:23:09.011] [Core] [INFO] [utils.tencent_record_helper:96]: [FFmpeg] stdout:
[2026-04-11 20:23:09.011] [Core] [DBUG] [utils.tencent_record_helper:97]: [FFmpeg] stderr: [amr @ 0x5941f60b02c0] Estimating duration from bitrate, this may be inaccurate
Input #0, amr, from '/AstrBot/data/temp/whisper_api_2edfd6a9.input':
Duration: 00:00:02.96, bitrate: 5 kb/s
Stream #0:0: Audio: amr_nb (amrnb) (samr / 0x726D6173), 8000 Hz, mono, fltp, 5 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (amr_nb (amrnb) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to '/AstrBot/data/temp/whisper_api_5201e777.wav':
Metadata:
ISFT : Lavf61.7.100
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 24000 Hz, mono, s16, 384 kb/s
Metadata:
encoder : Lavc61.19.101 pcm_s16le
[out#0/wav @ 0x5941f60b1bc0] video:0KiB audio:232KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.032762%
size= 233KiB time=00:00:04.96 bitrate= 384.1kbits/s speed=1.99e+03x
[2026-04-11 20:23:09.011] [Core] [INFO] [utils.tencent_record_helper:98]: [FFmpeg] return code: 0
[2026-04-11 20:23:09.113] [Core] [INFO] [preprocess_stage.stage:86]: 语音转文本结果: 能听得见我说话吗
[2026-04-11 20:23:09.113] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent
[2026-04-11 20:23:09.113] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention
[2026-04-11 20:23:09.113] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot - on_message
[2026-04-11 20:23:09.115] [Core] [DBUG] [agent_sub_stages.internal:166]: ready to request llm provider
[2026-04-11 20:23:09.115] [Core] [DBUG] [agent_sub_stages.internal:185]: acquired session lock for llm request
[2026-04-11 20:23:09.118] [Core] [DBUG] [core.astr_main_agent_resources:463]: [知识库] 使用全局配置,知识库数量: 0
[2026-04-11 20:23:09.118] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot - decorate_llm_req
[2026-04-11 20:23:09.118] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot-web-searcher - edit_web_search_tools
[2026-04-11 20:23:09.443] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.IDLE -> AgentState.RUNNING
[2026-04-11 20:23:09.444] [Core] [DBUG] [runners.tool_loop_agent_runner:312]: [BefCompact] RunCtx.messages -> [2] system,user
[2026-04-11 20:23:09.444] [Core] [DBUG] [runners.tool_loop_agent_runner:312]: [AftCompact] RunCtx.messages -> [2] system,user

AstrBot v4.22.3 非正常日志

[2026-04-11 20:46:02.081] [Core] [INFO] [core.event_bus:61]: [default] [ABot(aiocqhttp)] [会话]: [ComponentType.Record]
[2026-04-11 20:46:02.082] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']

对 到这就没有下文了

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions