Help running mpg321 while startup

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

Help running mpg321 while startup

Post by /RaspberryPi »


I want to play an audio after raspberry pi boots up by using “mpg321 audio.mp3”

I have created a python script called trigger.py

And the trigger.py contains

import subprocess import time

time.sleep(25) # wait for boot suborocess.call([‘/usr/bin/mpg321’, ‘/home/user/audio.mp3’])

And I’m calling this file at startup using /etc/rc.local file

I have included “python3 /home/user/trigger.py &” in the rc.local file

The problem is while manually running the trigger.py from command line it is playing the audio but it is not automatically playing the audio after reboot

Please help me with the same.
submitted by /u/greymatttt
[link] [comments]

Source: https://www.reddit.com/r/raspberry_pi/c ... e_startup/
/RaspberryPi
Post Reply

Return to “Raspberry Pi Forum”