Skip to content

chore: 在遮罩期间保持播放提醒音#1704

Merged
HelloWRC merged 1 commit into
ClassIsland:masterfrom
IsHPDuwu:fix/audio.play.not_comp
Mar 29, 2026
Merged

chore: 在遮罩期间保持播放提醒音#1704
HelloWRC merged 1 commit into
ClassIsland:masterfrom
IsHPDuwu:fix/audio.play.not_comp

Conversation

@IsHPDuwu

Copy link
Copy Markdown
Contributor

这个 Pull Request 做了什么?

在遮罩期间保持播放提醒音

破坏性变更

若 cancellationToken.IsCancellationRequested 为假无法清空播放队列(?)

相关 Issue

fix #1673
fix #1689

检查清单

  • 我已经在本地测试过这个 PR,确保欲实现的功能或修复的问题能正常工作。

@IsHPDuwu IsHPDuwu requested review from a team and HelloWRC as code owners March 13, 2026 17:04
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@HelloWRC HelloWRC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

事实上,这种实现方法可能不能实现跨提醒会话保持播放提醒音效。这里实际上是在控制提醒语音,而非提醒音效。

提醒音效是在 https://github.com/ClassIsland/ClassIsland/blob/master/ClassIsland/Services/NotificationWorkerService.cs#L187 进行播放的,并会在当前提醒会话结束时(如遮罩播放完毕或被打断)被取消播放。如果要实现这个功能,应该考虑将这个用于取消的 CancellationToken 保存到提醒请求中,并在整个提醒播放完毕或被打断时取消。

@IsHPDuwu IsHPDuwu requested a review from HelloWRC March 15, 2026 07:12
@IsHPDuwu

Copy link
Copy Markdown
Contributor Author

在 NotificationRequest.cs 里新增了 NotificationSoundCancellationTokenSource

让每个提醒请求都能保存自己那次提醒音效的取消控制

我应该没理解错吧)

@laoshuikaixue

laoshuikaixue commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

应该还有一个问题,就是如果应该显示通知,播放音频的时候,没有可显示的组件(比如方案里什么组件都没加),这些音频似乎都会在组件可用之后(添加了一个组件/切换有组件的方案)之后一次性突然全部蹦出来,十分吓人
不知道是不是这个问题导致的

@HelloWRC HelloWRC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IsHPDuwu IsHPDuwu changed the base branch from 2.0 to master March 29, 2026 01:41
@IsHPDuwu IsHPDuwu force-pushed the fix/audio.play.not_comp branch from 6a5c8c2 to d97224d Compare March 29, 2026 02:32
@IsHPDuwu IsHPDuwu requested a review from HelloWRC March 29, 2026 02:32
@IsHPDuwu

IsHPDuwu commented Mar 29, 2026

Copy link
Copy Markdown
Contributor Author

目前已经使用集控提醒完成测试

@HelloWRC HelloWRC merged commit 18f88b8 into ClassIsland:master Mar 29, 2026
2 checks passed
@HelloWRC

Copy link
Copy Markdown
Member

感谢您的贡献🤝

昔涟 爱

C14147 pushed a commit to sophia-schola/ClassIsland-NEXT that referenced this pull request Mar 29, 2026
Koharu-Mizuki pushed a commit to Koharu-Mizuki/ClassIsland-RB that referenced this pull request May 24, 2026
Koharu-Mizuki pushed a commit to Koharu-Mizuki/ClassIsland-RB that referenced this pull request Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

放学提醒音频可播放时长突然变短 2.0.2.0版后 上课、自动化提醒等功能播放提示音逻辑异常

3 participants