If you are on macOS or Linux and you bought (lol) a Google Chromecast (or equivalent) or Sonos speakers, I present to you Mkchromecast.

This script written in Python will allow you to stream compressed or uncompressed audio (lossless) directly to your speakers or connected devices, including in multiroom mode, from your Apple computer or Linux PC.

You can choose the tool to use: ffmpeg or avconv, as well as the encoding format (mp3, aac…etc.), the bitrate and sampling rate (44.1 kHz / 96 kHz) to have audio in high quality.

If you have Sonos speakers, in addition to mkChromecast, you will also need to install the soco lib:

pip3 install soco

The DMGs for macOS and the .debs for Debian/Ubuntu are there . And to compile the thing, everything is explained on the Github page.

Note that it is also possible to stream video like this:

bin/mkchromecast --video -i "file.mp4"

Or Youtube videos:

bin/mkchromecast -y https://www.youtube.com/watch\?v\=xxxxxxxx --video

There are far too many options for me to detail everything here, but you can for example add subtitles to videos, control the volume, cast a remote audio source from an IP…etc.

5/5 - (1 vote)

Tagged in:


About the Author

SAKHRI Mohamed

Founder & Editor

Passionate about the web, new technologies and IT, I share on easy-tutorials.com tutorials, tips, advice, online tools and software for Windows, Mac and Linux.

View All Articles