Play audio cd to chromecast
Thanks to: - https://github.com/martinohanlon/AutoRipper - https://github.com/balloob/pychromecast
Requirements:
- python3
- nodejs
- abcde
- pygame for python3
npm install
sudo apt-get build-dep python-pygame
pip3 install -r requirements.txt
sudo apt-get install abcde
cp config.json.dist config.json
Edit config.json
file:
chromecast_friendly_name
: target chromecast to play audiopublic_url_prefix
: the public url of the server.js server (needed by chromecast)
Launch launcher.py:
python3 launcher.py
crontab -e
Add this line to your crontab:
@reboot python3 /home/pi/mp3/laucher.py > /tmp/rip.log
server.js
will serve a fake big wav file. Chromecast will stream it.
launcher.py
will check if audio cd is here. If audio cd is ready, it launches the play.sh
script, and look for wav file. If wav file found, it launches it on chromecast
play.sh
will launch the nodejs server, and abcde to rip the disc, and writes pid files
stop.sh
will kill abcde and server.js