Hi all!
Playing around with trying to create a custom Shuffleboard widget, I was able to make one that plays sound. It’s up on GitHub at https://github.com/fixermark/shuffleboard/tree/sound-widget (if you clone that repo, remember to switch to the sound-widget
branch to see it). I’ll be putting together several write-ups on how I got from the example widget to here, but I figured I’d get it out in the open sooner rather than later so people can play with it.
To use it, use the 2022 FRC version of vscode to build and install the widget with
./gradlew :example-plugins:sound-widget:installPlugin
. Run your robot code, load Shuffleboard, put some Boolean data onto the tab, right-click and “Show as → Triggered Sound”. The box will turn grey and show “File does not exist.” Then right-click again, “Edit Properties,” click to the right of “Source file” and type in the absolute path to a WAV audio file (note: tested on Linux; maybe MP3 is supported on Windows? Not sure.).
When the boolean goes from false to true, the audio will play.
Enjoy, and let me know if you have any questions! In particular, I’d love to know if it works for people using Windows (need to dust off my configuration to test on a machine other than my laptop!).