bacon icon indicating copy to clipboard operation
bacon copied to clipboard

Custom sounds

Open nc7s opened this issue 8 months ago • 5 comments
trafficstars

Currently, we have some sounds hand picked by the authors baked into the compiled executable. It works, but has shortcomings. In Debian particularly, the included sound resources have too many copyright holders: even though they are OK license wise with CC0, we can't reliably attribute each to their respective author(s). I'll have to exclude them, and disable the sound feature for now. Allowing custom sounds won't solve the attribution problem, but does enable the feature.

Currently sounds are referred to by names, e.g. on_success = "play-sound(name=90s-game-ui-6,volume=50)". Presumably we can also refer by paths, e.g. play-sound(path=~/Audio/my-awesome-notification.mp3,volume=42).

We could also allow naming custom sounds, something like this:

# prefs.toml
[sound.collection]
my-awesome-notification = '~/Audio/my-awesome-notification.mp3'
# bacon.toml
[jobs.check]
on_success = 'play-sound(my-awesome-notification,volume=42)'

nc7s avatar Mar 06 '25 13:03 nc7s

No objection. If somebody's willing to work on the implementation, they're welcome.

Canop avatar Mar 06 '25 13:03 Canop

I'll try to throw something together this weekend :>

nc7s avatar Mar 06 '25 13:03 nc7s

Submitted a PR. In implementing it, though, I realized bacon.toml is often/sometimes committed to version control. It then poses a problem: if Alice configures a custom sound, then commits the bacon.toml, Bob won't be able to use it. There are various ways to work around that. But ultimately, should that be our concern?

nc7s avatar Mar 09 '25 16:03 nc7s

Personally, in most of my projects I've decided it's not a problem and for project where other people need to use it and might run into an issue I copy over any setting that need to be shared to the top of bacon.toml

c-git avatar Mar 09 '25 21:03 c-git

Nice to know the lifting trick, thanks ;)

Or support includes, but might complicate things a bit too far.

nc7s avatar Mar 10 '25 12:03 nc7s