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
You can create a startup sound using mplayer and a mp3 file.
Here is what you need:
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
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
Add the command to play the sound at the end of