Repository navigation
fix(asr): 长录音分段上传,macOS 目标失效时保留转写 - #1416
Merged
H-Chris233 merged 4 commits intoNov 9, 2026
Merged
Conversation
Whisper-compatible providers received the whole recording as one WAV unless they were on a short allowlist. On Groq's free tier (25 MB) anything past about 13 minutes failed with 413 and the transcript was lost. Default to 10-minute chunks (19.2 MB as WAV) when a provider sets no limit, and end each chunk at the quietest moment before the limit so a split does not cut a word in two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
insert_final promised a copy-only fallback but only Windows implemented it. On macOS the finished transcript reached neither the input nor the clipboard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Collaborator
|
开始审查 |
Keep the custom OpenAI-compatible provider's zero/blank setting as whole-clip transcription instead of applying the ten-minute fallback. Add a regression test with eleven-minute PCM for unset, empty, zero and null advanced configuration.
Use fixed-size sample chunks and repeat_n so the Linux and isolated iOS Core lint checks pass with warnings treated as errors.
H-Chris233
force-pushed
the
fix/whisper-long-recording-upload
branch
from
November 9, 2026 08:22
4cdc449 to
b7571d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
让 macOS 上的长录音不再丢失转写结果。未配置分段限制的 Whisper 兼容服务此前会把整段录音作为一个 WAV 上传;Groq 免费版上限 25 MB,约 13 分钟以上的录音会返回 413。另外,插入目标失效时,macOS 既不插入也不复制,转写结果只留在历史记录里。
修复 / 新增 / 改进
batch_asr_chunk_limit_ms:服务未配置限制时默认按 10 分钟分段(WAV 约 19.2 MB)。已有的 30 秒规则和用户配置的chunkDurationMs保持优先。split_pcm_by_duration:在接近上限的范围内(最多 15 秒,且不超过分段时长的 10%)选择最安静的位置切分,避免切断单词。分段长度不超过上限,拼接后 PCM 不变;能量相同时取最接近上限的位置,原有的等长切分行为不变。insert_final:macOS 上插入目标失效时改为复制到剪贴板,与该分支注释描述的「只复制」一致。兼容
mimo/dashscope自带的分段逻辑;音频压缩;分段失败后的单段重试。CopiedFallback。测试计划
cargo +1.99.0 test -p openless-core,cargo +1.99.0 check --manifest-path src-tauri/Cargo.toml,对改动的 core 文件运行rustfmt --checkbeta)。新增测试覆盖 pause 切分、无数据丢失、17 分钟录音的分段小于 25 MB,以及默认限制与用户配置的优先级。v2.0.1-tauri应用同样的改动并安装,对一段 17 分钟、此前返回 413 的录音执行历史记录的「重新转录」。Groq 约 4 秒返回完整转写,没有 413;之后的「重新润色」也正常。🤖 Generated with Claude Code