A lightweight Go library and CLI for streaming audio to Chromecast-enabled devices.
Warning
This project was originally developed as an internal plugin for Cider. It is being open-sourced in the spirit of sharing and transparency. While it works as described below, it is not actively maintained or supported. Treat this as a research snapshot rather than a production-ready library.
- Discover devices (mDNS + SSDP)
- Describe device (friendly name, manufacturer, model)
- Secure Cast session + receiver launch
- Play audio with metadata (title/artist/album/artwork)
There are two ways to use this library:
- Command Line Interface (CLI): Use a tool like wscat after starting the receiver app
- Foreign Function Interface (FFI): Build a shared library to call from other languages. See the Building FFI shared library section below.
The proto/cast_channel.proto file defines the CastMessage format. After making changes, regenerate the Go code with:
protoc --go_out=. --go_opt=paths=source_relative proto/cast_channel.proto
mkdir -p build/linux/amd64
GOOS=linux GOARCH=amd64 CC=gcc \
go build -buildmode=c-shared \
-o build/linux/amd64/libcider_cast.so \
./ffi/ffi.go
mkdir -p build/darwin/amd64
GOOS=darwin GOARCH=amd64 CC=clang \
go build -buildmode=c-shared \
-o build/darwin/amd64/libcider_cast.dylib \
./ffi/ffi.go
New-Item -ItemType Directory -Force -Path build\windows\amd64
$Env:GOOS = "windows"
$Env:GOARCH = "amd64"
go build -buildmode=c-shared `
-o build\windows\amd64\cider_cast.dll `
./ffi/ffi.go
Target 386 architecture if you need 32-bit support