I have a dumb work related chrome thing, i’d like to make it so that when a certain notification sound plays in chromium, my computer does a few things automatically for me

Does anyone know a good way to make this happen?

I imagine it’d have to be setup like:

when chrome starts playing audio && check if that audio matches soundfile.ogg && myscript.sh, but I don’t know any good cli utilities that could get something like that done, and if there are any better ideas!

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    Are you on linux? If you’re using pipewire (or pulseaudio), you can connect the chromium audio pipe to your audio analyzer, analyze the audio, and execute commands on a match. Here’s an example of capturing audio with pipewire. It’s in C, but there’s also a Rust crate.

    Maybe gstreamer could make it easier. Audio analysis will probably be some library that you have to search for.

    What you’re trying to do is not very straight forward, IMO.

    CC BY-NC-SA 4.0