-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add audio feedback for text selection #19850
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intended that both the caretMoved
and deselect
samples play when the selection is dismissed by keyboard arrow keys.
Eg. select some word in a middle of a sentence and then press left or right arrow key.
|
||
default: | ||
channel = selectCharSample?.GetChannel(); | ||
pitch += (SelectedText.Length / (float)Text.Length) * 0.15f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible division by 0 here, resulting in NaN
pitch. Shockingly, this doesn't crash, but instead plays the sound high-pitched. It's probably not intended for selection to change and Text.Length
to be 0
(framework-side bug) but I think this should be guarded against.
Also, pitch is double
, but this is casting to float
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How were you able to trigger a selection change with Text.Length
being zero? It's probably better to ensure OnTextSelectionChanged
is never called when Text.Length
is zero than guarding here?
Test failures here will be fixed via #19828, marking as prereq for now. |
selection-sfx.mov
FramedBeatmapClock
(and use in gameplay flow) #19828 (framework bump fixes)