In the article I will tell, finally, how
our radio station is designed from the inside.

It will focus on the main programs used and the general approach to the organization of round-the-clock broadcasting with the possibility of live broadcasts.
So what is an internet radio station? This is a software and hardware complex that generates some sound result. In our case, this is music, screensavers, live broadcasts. Listeners can connect to the stream with their favorite music player or listen from the site.
The easiest way to tell from the end, from the audience. Listeners connect to the broadcasting daemon icecast2 (hereinafter referred to as simply icecast) that distributes a ready-made mp3 stream to everyone. At the same time, another program is responsible for the formation of the mp3 stream, icecast can only switch between incoming streams.
')
In our case, in the normal mode, icecast broadcasts a stream that forms ices. If a presenter joins icecast to conduct a live broadcast, icecast automatically switches to it, as to a higher priority stream. By the way, the ices module works in parallel and does not know anything about what happened, that is, it continues to form its background thread. This, by the way, can be used (and enjoyed) by the presenter and relay it through itself, hauling to the voice and talking in pauses, but this is the topic of the previous article.
Icecast2: live broadcasts and stream switchingGenerally speaking,
Icecast2 is such a multiplexer, it has several input streams, between which it switches and there are listeners to whom it distributes the result.
How the live broadcast works is clear: from the moderator there should be a formed stream, which the icecast will distribute to the listeners. If this stream is absent, then icecast will broadcast the main stream formed by ices, which is discussed below.
Despite the seemingly rather simple purpose, icecast has a number of uniquely interesting possibilities, with the help of which you can greatly facilitate your life and diversify the work of the station.
For example, icecast allows you to assign scripts to switch threads. It is these scripts that send
radio messages to
Twitter when the airs start, and automatic recording begins, and when the live broadcast ends, the recording is automatically transferred to the proper place, the rss is updated, the message about the appearance of the recording goes to Twitter.
Such things make the radio, among other things, also convenient for listeners: it’s easy to get on the air, even if it’s not scheduled, and if you missed it, listen to it in podcast mode.
ices + ardj: main broadcastWhen there is no presenter, the radio plays music, jingles and micro-podcasts; this is all we do with ices with strong support from ardj.
Ices is engaged in decoding mp3 or ogg files, forming a continuous stream ready for retransmission, inside it there is a partial mixing of tracks (cross-fade).
In general, ices have two main modes of operation:
1) play music on a given playlist
2) call an external script that says what to play.
The first option is rather boring, we use the second one: ardj is responsible for the formation of the ether. When the next song comes to an end, ices calls ardj, which returns to him the name of the file with the next song or headband, which should now be played.
ardj is an invention of
umonkey , the logic of the work of ardj should be devoted to a separate article, or even a book, but in short, he can:
- ratings: you can vote for music;
- tags;
- playlists;
- preroll: you can make screensavers from musicians before songs,
- play queue (takes precedence over playlists, managed by people).
Accumulated votes for or against songs allow us to calculate conditionally “good” and “bad” music, this rating affects the frequency of rotation, there is a special time when sludge is played - candidates for removal from the rotation in general, and after 13:00, the music is played with an increased rating which is just nice to listen to.
All these possibilities of ardj allow us to orgasize a radio station close to real life: for example, to play something fun in the morning, and only quiet music at night, to dilute the whole thing with jingle, for example, we have an hour of micro-podcasts during the day and so on (our
broadcast network ) .
Administrators and ordinary users can interfere with the work of ardj with the help of jabber-bot messages.
Instead of conclusion“Radio I, too,” is deeply involved in open source ideas and plays free music, which we all know quite a bit, and the voting system allows us to build a digestible broadcast and find interesting free music.
The described approach, of course, is just one of the possible ones and it claims only to show how a functioning Internet radio station can be arranged.