This is the code I used to make an alarm clock out of a Raspberry Pi (model 1 B+, 512MB RAM) that plays motivational speeches at 6:30 in the morning to get my ass out of bed.
At first I was using a CLI YouTube client, but it would hang after a while due to not running on an interactive console
(being launched by crond
), and the audio support on Pi's have always been somewhat flaky.
I ended up using youtube-dl
to pre-download a playlist and using omxplayer
for its hardware-accelerated decoding
support. Works pretty well, except omxplayer
has no support for things like "playlists" or "shuffling" so I needed