Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active July 26, 2025 07:11
Show Gist options
  • Select an option

  • Save miguelmota/61e289c002396abdc8f817b9158ea0bb to your computer and use it in GitHub Desktop.

Select an option

Save miguelmota/61e289c002396abdc8f817b9158ea0bb to your computer and use it in GitHub Desktop.
Play soma fm radio from command line
# using mpg321 player
curl -s http://ice1.somafm.com/defcon-128-mp3 2>&1 | mpg321 -
# using mpv player
curl -s http://ice1.somafm.com/defcon-128-mp3 2>&1 | mpv -
# using afplay player (preinstalled on mac osx). Note afplay doesn't support streaming so we create a file descriptor to stream to.
exec 3<> /tmp/file.mp3 && curl -s http://ice1.somafm.com/defcon-128-mp3 2>&1 | tee >&3 | (sleep 1; afplay /tmp/file.mp3)
# using ffplay player (preinstalled on fedora)
curl -s http://ice1.somafm.com/defcon-128-mp3 2>&1 | ffplay -nodisp -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment