1

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

BlackWhiteX
  • 19
  • 1
  • 3

3 Answers3

2

You can create a startup sound using mplayer and a mp3 file. (Fixed)

Here is what you need:

  1. Install mplayer

sudo apt-get install mplayer

2.Go to root

sudo su

  1. Make sound directory in /etc

sudo mkdir /etc/sound

  1. Upload the sound file as mp3 to the sound directory

sudo mv /tmp/soundfile.mp3 /etc/sound/sample.mp3

  1. 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

MatsK
  • 2,882
  • 3
  • 17
  • 22
Chetan Bhargava
  • 1,252
  • 3
  • 15
  • 29
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,336
  • 6
  • 66
  • 105
0

Add the command to play the sound at the end of /etc/rc.local

Will
  • 371
  • 4
  • 17