I know that this question has already been answered, but the method described here is actually not working for me... o.O I read in some other forums that a different formatting is required, but I don't know which... If anyone could help me with this... I am running Raspbian's latest release as of 28/11/2014 Cheers
Asked
Active
Viewed 7,136 times
2
3 Answers
2
You can create a startup sound using mplayer and a mp3 file.
Here is what you need:
Install mplayer
sudo apt-get install mplayer
Make sound directory in /etc
sudo mkdir /etc/sound
Upload the sound file as mp3 to the sound directory
sudo mv /tmp/soundfile.mp3 /etc/sound/sample.mp3
Copy and paste below line on command promp
sudo echo "mplayer /etc/sound/sample.mp3" >> /etc/rc.local
make sure to upload your mp3 file to your raspberry pi in /tmp/ directory

Chetan Bhargava
- 1,262
- 3
- 15
- 29
-
The file
rc.local
is actually containing something about my IP-Adress... I am not familiar with scripting, would you be able to show me what exactly to add in that file? – BlackWhiteX Nov 30 '14 at 03:03 -
@BlackWhiteX I have updated my answer by formatting code and making it clear. – Chetan Bhargava Nov 30 '14 at 08:21
-
using your solution, when I type in
sudo echo "mplayer /etc/sound/sample.mp3" >> /etc/rc.local
I get-bash: /etc/rc.local: Permission denied
– BlackWhiteX Dec 02 '14 at 19:52
1
Instead of aplay
use omxplayer
which can read MP3, AAC, WAVE and a few others.
# /etc/init.d/start-sound
echo "Playing startup sound"
omxplayer /path/to/file.mp3 2>&1 >/dev/null &
omxplayer is pre installed with the latest (for a while now) and also you can do the same to play video to a selected output device.
If you get permission error try putting sudo
in front of omxplayer

Piotr Kula
- 17,307
- 6
- 65
- 104
chmod: changing permissions of '/etc/init.d/start-sound': Operation not permitted
– BlackWhiteX Nov 30 '14 at 02:55##BEGIN INIT INFO
part was actually missing). I am going to share the script here in some time, so everybody who is still trying to figure out how to create a Startup Sound can use it... – BlackWhiteX Nov 30 '14 at 03:24