| ID | 45074f15-b992-46a5-b920-e5cad3821b6b |
|---|---|
| DeertopiaVisibility | public |
Dad's radio thing
Dad wants me to code up a little raspberry pi project to play kexp radio i guess.
Fetch KEXP audio stream and output to headphone jack.
Ideas
Web dashboard
See "now playing" info.
Error log.
Notes
KEXP API
Browser calls /getsteamingurl which returns a JSON object. Field sg-url is a URL to an MP3 stream.
That URL can be curled into FFplay, e.g.
curl «URL» | ffplay -f mp3 -i pipe:
#!nix-shell -i bash -p ffmpeg curl
set -e
curl
Since the API is entirely undocumented, I think it may be best to instead use a headless Firefox script.
It looks like the URL
https://kexp-mp3-128.streamguys1.com/kexp128.mp3is hard-coded into the site. I'd been working under the impression of a far more volatile system! This may be way easier than I'd anticipated.getStreamInfoseems to be called everyrefreshSeconds(hard-coded to 30). This is easily observed in the browser's network logs.I think this is getting a little silly. Project on pause until I question Dad about why he can't just plug his computer into the speakers.