Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active February 2, 2020 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/61e289c002396abdc8f817b9158ea0bb to your computer and use it in GitHub Desktop.
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