olavfosse / eradio

The simple radio player for GNU Emacs
GNU General Public License v3.0
62 stars 6 forks source link

[[https://melpa.org/#/eradio][file:https://melpa.org/packages/eradio-badge.svg]]

** Synopsis eradio is a simple Internet radio player for Emacs.

The public interface consists of three functions and three variables.

*** Functions

*** Variables

** Installation The package is available in the Melpa repository.

*** Doom

+begin_src lisp

;; ~/.doom.d/packages.el (package! eradio)

+end_src

*** use-package

+begin_src lisp

;; ~/.emacs.d/init.el (use-package eradio :ensure t)

+end_src

** Media player eradio requires an external media player such as VLC or mpv. The command to be used is determined by the =eradio-player= variable. The head of =eradio-player= is the program and the tail is the arguments. The default command uses VLC from the =exec-path= variable(which may differ from =$PATH=), but it can be customized to use mpv, VLC.app or alternatively set to use something else entirely.

To use VLC.app, customize =eradio-player= to =vlc-mac= or set it to =("/Applications/VLC.app/Contents/MacOS/VLC" "--no-video" "-I" "rc")=. To use mpv, customize =eradio-player= to =mpv= or set it to =("mpv" "--no-video" "--no-terminal")=

** Keybindings eradio does not bind any keys by default. Therefore you should bind them yourself. The following snippets are just suggestions. You can of course use any keybindings you would like.

*** Doom

+begin_src lisp

;; ~/.doom.d/config.el (map! :leader (:prefix ("r" . "eradio") :desc "Play a radio channel" "p" 'eradio-play)) (map! :leader (:prefix ("r" . "eradio") :desc "Stop the radio player" "s" 'eradio-stop)) (map! :leader (:prefix ("r" . "eradio") :desc "Toggle the radio player" "t" 'eradio-toggle))

+end_src

*** Vanilla

+begin_src lisp

;; ~/.emacs.d/init.el (global-set-key (kbd "C-c r p") 'eradio-play) (global-set-key (kbd "C-c r s") 'eradio-stop) (global-set-key (kbd "C-c r t") 'eradio-toggle)

+end_src

** Radio channels eradio comes without any radio channels by default, but here are some of my favorites.

+begin_src lisp

;; ~/.doom.d/config.el or ~/.emacs.d/init.el (setq eradio-channels '(("def con - soma fm" . "https://somafm.com/defcon256.pls") ;; electronica with defcon-speaker bumpers ("metal - soma fm" . "https://somafm.com/metal130.pls") ;; \m/ ("cyberia - lainon" . "https://lainon.life/radio/cyberia.ogg.m3u") ;; cyberpunk-esque electronica ("cafe - lainon" . "https://lainon.life/radio/cafe.ogg.m3u"))) ;; boring ambient, but with lain

+end_src

If you are looking for more channels I encourage you to check out the SomaFM [[https://somafm.com/][catalog]]. They have a lot of good channels of all genres and aesthetics. Needless to say I am not associated with SomaFM.

** Troubleshooting Some VLC ports are incapable of playing Internet radio. This seems to be the case with [[https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/x11/vlc/][OpenBSD's port]]. To verify that your vlc installation works run =vlc --no-video -I rc = for example =vlc --no-video -I rc https://somafm.com/defcon256.pls=. Be aware that it might take some seconds before the audio starts. That is expected. A possible solution to this problem is to instead use mpv, which works as expected on OpenBSD too.