I have written a python script that uses the GPIO to flash some LEDs and play a sound when a switch is opened (for a proof of concept burglar alarm).
The lights work and the sound plays, but unfortunately when the sound is played, no other commands are processed at the same time, leading to a delay until the sound is finished playing.
I would love to know, is it possible to have multiple commands executed simultaneously in python?
Or if not, is there a sound player available on the pi that can play a file without hanging terminal during playback?
Thanks in advance guys!