Open thiagoeh opened 2 years ago
I think the AppleScript API would work for you. @marcuswu added support for changing app volumes recently. https://github.com/kyleneideck/BackgroundMusic/tree/master/BGMApp/BGMApp/Scripting
Would it be possible to get an example of how to change the volume of a specific app using the AppleScript API? I also don't have much experience with AppleScript but would love to be able to mute/unmute apps via the command line.
@plt3
tell application "Background Music"
set vol of (a reference to (the first audio application whose bundleID is equal to "com.apple.Safari")) to 75
end tell
You can also use name
instead of bundleID
.
Great, thank you!
My end objective is to able to have a timer that automatically adjust the volume of an specific application on Background Music. Instead of directly asking for this feature, which maybe put at low priority and never be implemented, I would to do a feature request for a way to programatically adjust the volume for a single application. Maybe something such as a CLI interface (for which I would build a simple shell script to implement the timer and final command to adjust the volume).
My use case is to be able to temporarily mute an application (such as a live streaming), and unmute it after some minutes (to check if there is some relevant audio being streamed).
This is possibly a duplicate of https://github.com/kyleneideck/BackgroundMusic/issues/278 but I will leave to the maintainers to give a verdict on that.
(Thanks for the project! It's very useful to me).