-2

Here's my try:

[Unit]
Description=play the a team song

[Service]
ExecStart=/usr/bin/mpg123 /home/pi/Music/the_a_team.mp3
RuntimeMaxSec=10

The song plays 21 seconds and then stops. I don't get it. I also didn't find another solution like telling mpg123 to play just the first n seconds. Please help me. Any solution is fine.

Lukas Kitsche
  • 147
  • 1
  • 1
  • 5

1 Answers1

0

Try this:

[Unit]
Description=play the a team song

[Service]
ExecStart=/usr/bin/ffplay /home/pi/Music/the_a_team.mp3 -t 10 -autoexit -nodisp

Note that ffplay is part of the ffmpeg package.

oxagast
  • 397
  • 1
  • 12