Play audio over shell on macOS

shell_command:
  play_alert: afplay /Users/server/.homeassistant/sounds/Alert.mp3

This command works directly in Terminal, but not as a script from Home Assistant. How can I fix this?

It did work. Just for reference.