-
Notifications
You must be signed in to change notification settings - Fork 11k
New sounds #38154
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
Draft
elkoled
wants to merge
25
commits into
master
Choose a base branch
from
sound
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
New sounds #38154
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
6ff5e7a
fix soundd long duration playback and mic feedback
elkoled d82a36b
new sounds
elkoled a0c7dba
redefine AudibleAlert
elkoled a608519
chg alertSound2
elkoled b6119b3
rn laneChange
elkoled 3f175a2
fix
elkoled f1f3c37
Merge remote-tracking branch 'origin/master' into sound
elkoled d6bb423
exp cutoff
elkoled 3626076
no sound cutoff
elkoled 1256930
fadeout
elkoled 5fc57a6
rename
elkoled 6e09e0b
update soft warning
elkoled 1510072
laneChangeStarted event
elkoled db84aea
raise floor to 22
elkoled 6ffbd6d
single tone sounds
elkoled 5da41f1
pre alert
elkoled 13b2144
try pre alert
elkoled bfc8346
update prompt sounds
elkoled 6dce3a8
update prompt sound
elkoled 3788b1d
add dual sound toggle
elkoled a9ce8a9
move toggle
elkoled 361b6a6
rename
elkoled 6a631b4
Merge branch 'master' into sound
adeebshihadeh 068480a
update prompt sound
elkoled 33d2440
add sound debug
elkoled File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import pyray as rl | ||
| from openpilot.common.params import Params | ||
| from openpilot.system.ui.lib.application import gui_app, FontWeight | ||
| from openpilot.system.ui.lib.text_measure import measure_text_cached | ||
| from openpilot.system.ui.widgets import Widget | ||
| from openpilot.selfdrive.ui.ui_state import ui_state | ||
|
|
||
|
|
||
| class SoundDebug(Widget): | ||
| def __init__(self): | ||
| super().__init__() | ||
| self._params = Params() | ||
| self._enabled = self._params.get_bool("ShowSoundDebug") | ||
| self._font = gui_app.font(FontWeight.MEDIUM) | ||
|
|
||
| def _render(self, rect): | ||
| if gui_app.frame % 30 == 0: | ||
| self._enabled = self._params.get_bool("ShowSoundDebug") | ||
| if not self._enabled: | ||
| return | ||
|
|
||
| sd = ui_state.sm["soundDebug"] | ||
| alert = str(sd.alert).split(".")[-1] | ||
| rows = [ | ||
| ("volume", f"{sd.volume * 100:.0f}%"), | ||
| ("ambient", f"{sd.ambientDb:.1f} dB"), | ||
| ("mic raw", f"{sd.rawDb:.1f} dB"), | ||
| ("alert", alert), | ||
| ] | ||
| fs, pad, gap, lh = 32, 14, 24, 40 | ||
|
|
||
| label_w = max(measure_text_cached(self._font, lbl, fs).x for lbl, _ in rows) | ||
| value_w = max(measure_text_cached(self._font, val, fs).x for _, val in rows) | ||
| w = 2 * pad + label_w + gap + value_w | ||
| h = 2 * pad + lh * len(rows) | ||
| x0, y0 = rect.x + rect.width - w - 6, rect.y + 6 | ||
|
|
||
| rl.draw_rectangle_rounded(rl.Rectangle(x0, y0, w, h), 0.12, 10, rl.Color(0, 0, 0, 210)) | ||
| for i, (label, value) in enumerate(rows): | ||
| y = y0 + pad + lh * i | ||
| rl.draw_text_ex(self._font, label, rl.Vector2(x0 + pad, y), fs, 0, rl.Color(170, 170, 170, 255)) | ||
| vx = x0 + w - pad - measure_text_cached(self._font, value, fs).x | ||
| rl.draw_text_ex(self._font, value, rl.Vector2(vx, y), fs, 0, rl.WHITE) |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
this looks like it will break backwards compatibility with old logs?
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.
the schema is identical up to @Confirmation, tested with master log against this branch.