Source code for a 5 buttons mp3 jukebox running on a raspberry pi that I build for my boys (5 and 4 years old) for christmas 2019.
Add the follwoing line to get the script started at boot up.
@reboot export DISPLAY=:0.0 && cd /home/pi && nohup python3 /home/pi/musicbox/music_box.py &
@reboot
ensures that the line will be run at each rebootexport DISPLAY=:0.0
since I use{pygame}
and it has problems with beeing run headless I add this line to make it work withoutsudo
and without a display.nohup
is used so that the line finishes immediately althoughmusic_box.py
actually is an infinite loop.
// Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // IMPORTANT PART to make pygame work without actual display
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {"DISPLAY": "0.0"}
}
]
}
Free online text-to-speach (mp3) service:
free so far: https://console.aws.amazon.com/polly/home/SynthesizeSpeech no free anymore: https://notevibes.com/de/