Sounds alerts when long-duration commands are run on the REPL
There are for now three exported macros: @ding
, @ohno
and @elevator
:
@ding ex
will play a random bell sound at the end of the execution ofex
.@elevator ex
will play a random elevator music whileex
is running.@ohno ex
will play an error sound if theex
process is failing
Examples
@ding sleep(3)
@elevator sleep(10)
@ohno sqrt(-1)
To avoid having to write these macros everywhere, there are two functions to directly integrate the sounds to your workflow: ding_repl(activate=true)
ohno_repl
and elevator_repl(activate=true)
.
If the execution in the REPL takes more than a (configurable) time, a ding will play at the end and an elevator music will play during the execution respectively.
Although meager, the different options such as the minimum running time for the sound trigger and the refresh rate can be configured in a Ding.toml
file present in the current working folder.
All sounds will be downloaded in the first execution of using Ding
. These files are royalty free and come from the sound bank pixabay.com.
The sounds are played using FFplay
which is a library of FFmpeg
.
- Allow to add new music files -> Source for many open-source sound files
- Allow to play another song when process finishes
- Introduce fading between songs
- Add "failure" sound, when execution returns an error
- Ensure order of sound playing (elevator -> ding)
- Search for config file in more different paths.
- Add more options such as
- Exclude/Include list of sounds
- Sound level