My jank self-hosted radio

 

https://fm.138.io

 

Beware. Old code projects ahead.

This is some history along with classy screenshots of my internet radio wheel-reinventing.

Self-hosted radio

People like community radios! Originally, I used shoutcast and icecast (the FOSS version) with fuckin' WINAMP. If you could open a port - still an impassable barrier to tech wizardry for some - you could stream what you were listening to your friends while you hung out.

WINAMP and SHOUTcast

But what if you want the audio files stored on a server and the radio to be constant, not just when your computer is playing music and shoutcast is enabled? Subsonic (and the rest of the sonic stack) get an honourable mention - I still use airsonic-advanced, but syncing audio isn't great. Another option: You could use some servers with icecast. But, I'd always been a fan of listening rainymood with jazz and wanted the same - two files to stream at once!

VLC, which has everything, also has an HTTP stream and a web interface -I http.

default VLC web interface

class, style, and just the right amount of modesty

You can add rain, but it means the listener will need to open two instances:


i@pc:~ cvlc /path/to/music/playlists/default.m3u -I http \
--http-host 127.0.0.1 --http-password PASSWORD \
--http-port 8138 --extraintf rc \
--sout=#transcode{vcodec=none,acodec=mp3,ab=320,channels=2,samplerate=44100}:http{mux=mp3,dst=127.0.0.1:8139} \
--sout-keep --random --loop --file-caching 1000 --quiet

i@pc:~ cvlc /path/to/ambience/rain.mp3 \
--sout=#transcode{vcodec=none,acodec=mp3,ab=320,channels=2,samplerate=44100}:http{mux=mp3,dst=127.0.0.1:8140} \
--sout-keep --loop --file-caching 500 --quiet

This can be (and was) combined withpython-vlc and threading to make some sort of jank, insecure server.

You can make a custom client to handle the two audio streams:

Of the jank interfaces I've made, probably the coolest one

And learn to use ncurses for fun. It also had a jaaaaaaaaaaaaaaaaaaaaaaaaaank voice-clip that'd fade-lower the volume of the music and rain players and grab a clip as specified by a dedicated 138fm website. Naturally also a horrific QT-based playlist-maker.

more class, more style, and more just the right amount of modesty

One could also control the server with an XMPP chatbot called errbot. Unfortunately, it doesn't have a matrix backend. There was a failed attempt or two. So, I've since moved to opsdroid which uses matrix-nio for encrypted chat support.

in a world before fstrings

A draft web player

Modern times

https://github.com/dud1337/MorphOvum

Streams one mp3-encoded HTTP file that combines 3 players: Music, ambience, and clips (think "you're listening to blah blah FM"). It actually does some cool stuff in general, and is definitely more personalised than using icecast to stream your collection. Read the git for more.

slightly less regal design than usual due to public peasant-accessible code

The clips I personally use are custom. My favourite one was happening to work with an Irish voice-actress who did the voices of one of the characters in an old Irish children's show, and asking her to tell my friend James to fuck off.

an example of a few API commands via an opsdroid interface

It's a single containerised instance which uses pulse-audio without needing hardware. Technically there are 4 VLC player instances. One streams a virtual output to http. The other three - music, ambience, and clips - stream to the virtual output.

It generates a flask api based on decorated class methods. In addition to autogenerating the API documentation:

A thread for scheduling audio clips like "you're listening to morphovum!" which attenuates the other players.

And again...

https://fm.138.io

 

↑ Top  ⌂ Home