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 &
AutoStart the Jack Server
nano ~/.config/autostart/jackd.desktop
[Desktop Entry]
Type=Application
Name=Jack-D
Exec=jackd -p 8 -r -m -d dummy > /dev/null 2>&1
StartupNotify=false
###
Comment=Setup JACKD to prevent messages
NoDisplay=true
###Exec=sh -c 'xset m 20/10 10 r rate 500 30 b on'
###NotShowIn=GNOME;KDE;XFCE;
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 omxplaye
Make The Startup Sound Part Of The Boot Process
Use the nano text editor to open up a file called rc.local
within the /etc
directory:
sudo nano /etc/rc.local |
Scroll down to the bottom of that file, and just before the line that states exit 0
, add the following line:
omxplayer /etc/sound/logon.wav 2>&1 >/dev/null & |
Again, remember to replace the file name logon.wav
with whatever you have called your audio file. Once you have added the line to the rc.local file, use Ctrl+O to write out (save) the file and then Ctrl+X to exit.