Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): 通知音がほぼ同時に鳴った場合は再生をブロックするように(音割れ防止) #12433

Merged
merged 6 commits into from
Nov 26, 2023

Conversation

kakkokari-gtyih
Copy link
Contributor

What

通知音が25ms以内に複数回鳴りそうになったらブロックするようにした

Why

Fix #12412

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Nov 24, 2023
@kakkokari-gtyih kakkokari-gtyih changed the title fix(frontend): 通知音が同時に鳴った場合は再生をブロックするように fix(frontend): 通知音がほぼ同時に鳴った場合は再生をブロックするように Nov 24, 2023
Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (5bdae9f) 78.69% compared to head (b41c6a6) 78.55%.

Files Patch % Lines
packages/frontend/src/scripts/sound.ts 10.00% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12433      +/-   ##
===========================================
- Coverage    78.69%   78.55%   -0.14%     
===========================================
  Files          178      177       -1     
  Lines        23605    23486     -119     
  Branches       496      496              
===========================================
- Hits         18576    18450     -126     
- Misses        5029     5036       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kakkokari-gtyih kakkokari-gtyih changed the title fix(frontend): 通知音がほぼ同時に鳴った場合は再生をブロックするように fix(frontend): 通知音がほぼ同時に鳴った場合は再生をブロックするように(音割れ防止) Nov 24, 2023
@kakkokari-gtyih
Copy link
Contributor Author

同時鳴動のしきい値は25msとかなりシビアにしてあるので、重複の通知音もちゃんと鳴ります

@syuilo syuilo merged commit 755ca97 into misskey-dev:develop Nov 26, 2023
15 checks passed
@syuilo
Copy link
Member

syuilo commented Nov 26, 2023

👍

if (sound.type == null || !canPlay) return;

canPlay = false;
playFile(sound.type, sound.volume).then(() => {
Copy link
Member

Choose a reason for hiding this comment

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

playFileがエラーしたときに音が一切鳴らなくなりそうで若干不安な気がしますが大丈夫そうですかね

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ほんまや

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anatawa12 1dd7916単体でPRとか立ててもらえます…?

Copy link
Member

Choose a reason for hiding this comment

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

気づくの遅れました。わかりました。

anatawa12 pushed a commit to anatawa12/misskey that referenced this pull request Nov 27, 2023
syuilo pushed a commit that referenced this pull request Nov 29, 2023
* chore: 音声が一切鳴らなくなる可能性を軽減

#12433 (comment)

* chore: IIFEではなくPromise.prototype.finallyを使用するように
anatawa12 added a commit to anatawa12/misskey that referenced this pull request Nov 29, 2023
* chore: 音声が一切鳴らなくなる可能性を軽減

misskey-dev#12433 (comment)

* chore: IIFEではなくPromise.prototype.finallyを使用するように
@kakkokari-gtyih kakkokari-gtyih deleted the fix-12412 branch December 8, 2023 06:35
camilla-ett pushed a commit to kaseiski/misskey that referenced this pull request Jan 2, 2024
camilla-ett pushed a commit to kaseiski/misskey that referenced this pull request Jan 2, 2024
* chore: 音声が一切鳴らなくなる可能性を軽減

misskey-dev#12433 (comment)

* chore: IIFEではなくPromise.prototype.finallyを使用するように
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

更新が一気に大量に入ると通知音がダブって音割れする
3 participants