How can i get sound when script executed via systemd service?

sudo requires interaction by a user.

A common error is to think that systemd services should run as root

Create a user service in ~/.config/systemd/user/ - it will do what you want.

You could look at this topic to get an idea

Another example is

4 Likes