[Unit] Description=play the a team song [Service] ExecStart=/usr/bin/mpg123 /home/pi/Music/the_a_team.mp3 RuntimeMaxSec=10
歌曲播放21秒,然后停止。我不明白。 我也没有找到另一种解决方法,比如告诉mpg123只玩前n秒。请帮帮我。任何解决方案都可以。
试试这个:
[Unit] Description=play the a team song [Service] ExecStart=/usr/bin/ffplay /home/pi/Music/the_a_team.mp3 -t 10 -autoexit -nodisp
请注意,ffplay是ffmpeg包的一部分。