Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 27 additions & 29 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ opencv = ">=4.11.0,<5"
openssh = ">=10.5p1,<11"
paramiko = ">=4.0.0,<5"
pkg-config = ">=0.29.2,<0.30"
playsound = ">=1.3.0,<2"
portaudio = ">=19.7.0,<20"
protobuf = ">=6.31.1,<7"
psutil = ">=7.1.3,<8"
Expand Down Expand Up @@ -204,6 +203,8 @@ construct = ">=2.10.56, <3"
syrupy = ">=5.0.0, <6"
exhale = ">=0.3.7, <0.4"
mjviser = ">=0.0.12, <0.0.15"
# conda-forge has no playsound3, but the code imports it instead of the unmaintained playsound
playsound3 = ">=3.3.2,<4"

[feature.robot.dependencies]
ros-jazzy-nmea-msgs = ">=2.1.0,<3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ def __init__(self, blackboard, dsd, parameters):
def perform(self, reevaluate=False):
try:
import playsound3

playsound3.prefer_backends("ffplay")
except ImportError:
self.blackboard.node.get_logger().error("Failed to import playsound3")
return self.pop()

try:
playsound3.playsound(self.audio_file, block=False)
except playsound3.playsound3.PlaysoundException:
pass
self.blackboard.node.get_logger().error(f"Failed to play sound file: {self.audio_file}")

return self.pop()
Loading