I have built a "smart bell" for my home, where at the press of the door bell button a sound is played by my pi, out of the audio jack.
My program is written in c and the command I use to play the sound is the following:
I find the response of the bell a bit slow. It takes a second or two for the bell to be heard from the moment the button is pressed. I guess this is the time needed to start the mpg123 program and read the appropriate mp3 file.
Code: Select all
system("/usr/bin/mpg123 /data/makhome/doorbell.mp3 > /dev/null");
Is there a better and faster way to do this? Any ideas/recommendations will be appriciated.