Experimental Streaming Radio — Node.js + FFMpeg
I developed the project using Node.js, FFMpeg, and FFServer. Essentially, it's a live stream radio station. Music plays 24/7, emanating from my Raspberry Pi. I plan to release the JavaScript source code at a later date and make it available on my GitHub.
How it works
The project consists of two main components: a broadcast server and a website for streaming.
Upon startup, the broadcast server sends its internal data to the website. It maintains a playlist of all the music, which is played continuously. When the end of the playlist is reached, it loops back to the beginning. Each track is loaded and streamed from FFMpeg to FFServer. Additionally, the track information is sent to the website via HTTP POST and saved in memory cache as well as a JSON data file for failover.
The website monitors track changes using Server-Sent Events. If the track changes, the client-side JavaScript updates accordingly. A visualizer, represented by frequency bars, accompanies the music playback, though it's not compatible with iOS devices.
On the broadcast server, there's an admin portal allowing for stream control, playlist switching, and track management. Future features I plan to implement include more playlist control options (such as repeat and shuffle), queue management, and advertising intermissions.