16

I am running RPi headless and would like it to play a sound (like when a Mac boots) so I know it is booting and how far it got. I can play music/wav files now, What is the best way to have something play a sound file when RPi boots?

Note, it doesn't have to be very early on, it would be fine if RPi boots, does everything it needs to do and then when it is ready for someone to login the sound plays.

Update 1: I am using Raspbian “wheezy”

Ghanima
  • 15,958
  • 17
  • 65
  • 125
kevin
  • 1,284
  • 3
  • 14
  • 26

2 Answers2

12

Essentially all you have to do to create a start-up script is the following:

Create a file here and make it executable:

sudo nano /etc/init.d/start-sound && chmod +x $_

Add it to the default runlevel:

sudo update-rc.d start-sound defaults

All your script really needs to do is call aplay on an audio file. Something like this:

# /etc/init.d/start-sound

echo "Playing startup sound"
aplay /path/to/file.mp3 2>&1 >/dev/null &
Jivings
  • 22,656
  • 11
  • 94
  • 140
0

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

Will
  • 371
  • 4
  • 17