I'm able to play sound files from the command line, but get an error 1 from the exec node.
"High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
Version 0.3.2-1 (2012/03/25). Written and copyrights by Joe Drew,
now maintained by Nanakos Chrysostomos and others.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
tcgetattr(): Inappropriate ioctl for device
Directory: /home/pi/Music
Playing MPEG stream from test-of-mpg321_Joanna-standard.mp3 ...
MPEG 2.0 layer III, 48 kbit/s, 22050 Hz mono
Can't find a suitable libao driver. (Is device in use?)"
That will be because the environment in which the service runs is different to the environment when a user is logged on. Possibly a PATH issue or permissions. I don't know enough the subject to say what it might be in this case.
Is the service being run as the same user as when you run it from the command line?
If you login using ssh and try to run from the command line then, does it work?
It works fine at all times if I run from the command line, when I use node-red-pi to start node-red it still works, If I use "sudo systemctl enable nodered.service" then I'm done, it no longer works even if I use "sudo systemctl disable nodered.service" to stop it.
Just saying that once I set it up as a service, mgp321 no longer works, even if I reboot the pi and restart Node-Red manually (after disabling the nodered.service).
I got that to work, sorta, it was cutting off the end of the MP3, I'm using this for announcements in a manufacturing setting, it cuts off the last word or two more often than not. I did get MPG321 to work, I just have to manually start Node-Red after reboots.