How to listen to Code Radio in VLC Media Player in just 2 simple steps

How to listen to Code Radio in VLC Media Player in just 2 simple steps
0

I enjoy listening to Code Radio while I'm working. The music helps me focus and block out the noise of the surrounding office.


This is a companion discussion topic for the original entry at https://www.freecodecamp.org/news/play-code-radio-on-vlc/

Great thanks for the explanation on how to do it. I enjoy Code Radio also. I have been using VLC Media Player for a long time but never knew this.

Great writeup dude. I’ve been using a similar process for various streams I listen to throughout the day. As much as I appreciate VLC, I prefer mpv see just for the fact that I have customized a lot of the configuration already see. I’d prefer to not have another floating window to juggle :clown_face: between on my desktop, so I open a new window using tmux within a tmux session, and paste the link to the stream like so

 mpv --vid=no 'https://coderadio.freecodecamp.org/'radio/8010/radio.mp3

A couple of advantages this provides

  • no floating window
  • i can setup a key binding to quickly record a song / stream if desired
  • icy-titles are listed in the playback to STDOUT
  • obvious less system overhead than keeping another browser tab or even another desktop window active
  • mpv allows for the setup of MBP media key bindings so I can control CLI playback using media keys as well.

Bonus

  • on macOS I use Clipy to maintain a list of quick copies to paste into a terminal without having to type out the entire mpv command, and obviously I have setup a key binding to quickly list all the links to be commands to quickly pasted in the terminal.

Obtaining the media source

A different approach for gathering an online stream / source is to use the network tab in the developer tools to see a list of all the sources the browser tab pulls in. That said, I didn’t see a .mp3 source file like you listed when viewing the source for webpage, but a quick inspection of one of the JSON payload responses yielded a key / value pair that is the same link you provided in your writeup. Same result …different approach. :+1:

mpv CLI playback > Disadvantages

  • if using an app such Background Music on macOS a cli mpv can not be hooked into the app for auto pausing, however when playing streams that are realtime audio I much prefer to mute the stream than pause. So I end up mashing the m key to mute a stream if I need to watch / listen to something else.

Once again, great writeup, and didn’t even know there was a radio broadcast until I got the email in my inbox.

cheers :doughnut:
Chris

Thank you for posting this.

Great article, for those interested, I also made a desktop player that you can see here: Code Radio fans, I created an desktop player!

Can you put the playlist on an mp3 player? If so, how?

that was really helpful, thanks.

Yes this was a great tip! Happy listening! :grinning: