Repository navigation
fix(audio): 空闲时释放提示音输出与防休眠占用 - #1248
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
H-Chris233
approved these changes
Oct 28, 2026
Collaborator
|
合并前必须补的证据
|
Collaborator
|
@appergb 来验收 审查没问题 |
appergb
requested changes
Oct 28, 2026
appergb
left a comment
Collaborator
There was a problem hiding this comment.
请求修改,本 PR 不予通过。
- 当前 PR 涉及的 UI/交互方向与现版本不一致,现有 UI 问题不是局部音频提示音修复可以覆盖的范围。
- 新版本已经重构整套 UI 逻辑和页面衔接方式,本 PR 基于旧的 UI 逻辑继续修改,不能作为当前版本的合并基础。
请不要按当前 PR 继续合并。后续如果重新提交,需要基于当前版本的 UI 架构和交互逻辑重新整理,并先解决整套 UI 一致性问题。
Collaborator
|
这个 PR 的更改暂时不予通过:它与当前 UI 设计方向不一致,并且在 macOS 端完全无法正常使用,与当前的 UI 和目标方向不一致,暂时搁置。 |
2 tasks done
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.
摘要
修复桌面 Web Audio 提示音在空闲时持续占用系统输出设备的问题。启动预热不检查
audioCueOnRecord,即使用户关闭提示音,胶囊窗口挂载仍会创建并 resume 一个 AudioContext;播放结束或停止也只停止 oscillator,没有释放 context。在 macOS 安装版
v2.0.1-tauri上进行了对照:退出应用后输出流和 coreaudiod 的PreventUserIdleSystemSleepassertion 消失;重新启动但不听写便出现 BuiltInSpeakerDevice 输出及 assertion;关闭录音提示音后重新启动仍复现。听写结束时麦克风自身的 assertion 正常释放,但 WebKit 输出的 assertion 继续存在。当前 beta 仍保留相同预热和不释放路径。修复 / 新增 / 改进
disposeAudioCue():初次读取到禁用设置、实时关闭提示音、监听器卸载或原生所有权变化时,取消待恢复请求和计时器并关闭 context。迟到的 Promise / 旧 onended / 旧停止计时器不能干扰下一次播放。兼容
测试计划
cd openless-all/app && npm run build;结果:TypeScript 和 Vite 生产构建通过(仅有既有 bundle-size warning)。node scripts/audio-cue-runtime.test.mjs;结果:生命周期与恢复回归通过。node scripts/audio-cue-listener-contract.test.mjs;结果:按需启动、禁用设置清理和 owner 隔离契约通过。src/**/*.test.ts全部 62 项;结果:通过,含src/lib/audioCue.test.ts。git diff --check;结果:通过。npm test全量:生产构建及此前执行的脚本通过,随后scripts/check-hotkey-injection.mjs调用 Cargo 被本机 rustc 1.95.0 阻断(上游 openless-core 要求 1.99)。没有跳过或修改此门禁,需要上游 CI 继续确认。pmset -g assertions和 coreaudiod 日志确认没有遗留 WebKit 输出 assertion,且提示音正常。scripts/audio-cue-*.test.mjs;安装版的对照结果如摘要所述。未提交用户设置、听写内容或私人日志。