The story of a man who became obsessed with hosting his own radio station and how he achieved his objective.
Let’s Back up a little here..
I’ve always enjoyed listening to podcasts, and streaming audio and often found myself wondering “How do they do that?”. Then I began to think about what it would be like to be able to do that too, and wonder how ‘hard’ it be to actually host a live broadcast and send out my signal to the world. Thus, the seed was planted, and it grew (and how). I researched blogs, tutorials, websites, software and anything I could read about the topic of “Broadcasting on the Internet” and the more I read, the more intrigued I became — to the point of obsession. And, after a week or so, I set sail for the grand oceans of the unknown and embarked on an adventure which took me to places I never knew existed.
The Components of Hawkwynd Radio
This list makes up the services and applications I used to build Hawkwynd radio:
My Project Requirements
I wrote down a list of action items I wanted my project to perform:
- Capture the results from Musicbrainz and store it in the MongoDB if it doesn’t exist. This reduces repeat calls for an Artist/Title to Musicbrainz and assures a faster response time when the next song is being played. Also, it assures data returned is consistently being presented.
- For each Artist/Title query, I only wanted the FIRST recording, or the oldest release that recording is a part of. For example, Depeche Mode “Personal Jesus” first appeared on “Violator” in 1989.
- Gather information about the release, from Wikipedia, if available.
- Gather information about the artist, from Wikipedia, if available.
- Capture the release (album) cover image to display on the page.
- Capture the label the release was released by, as well as the year the release was released.
- Capture the artists credits from the recording metadata, by instrument or vocal
- Capture the release’s track list (all the songs on the album) in the proper order they appear.
At this point, I sat down (I was hardly standing, more like pacing about aimlessly in thought) and began building the request and search functions I needed to get my metadata. There are only 2 items I am using in my request:
- The Artist – The name of the band/artist who is credited with the song. Typically, this information is kept in an MP3 header, and is easily displayed by MIXXX, and transmitted to the Shoutcast server as the first part of a string.
- The Title – The song’s title. Again, this information is easily read by MIXXX and transmitted to the Shoutcast server.
In it’s simplest configuration, MIXX sends a string to the Shoutcast server to announce the song it’s playing, as well as the stream of music as it’s playing. Something like “The Beatles – Help!” as a single string. Easily configured in the Broadcast section of MIXXX. I will write a separate post regarding MIXXX soon, I promise.
with the music being played, along with some relative content such as Artist info, links to learn more and buy the products they’re throwing at you in small little advertisement squares everywhere which do nothing but distract me from what I really want to read or see. What I wanted to achieve was a simple layout, with everything I needed in one screen.
 The release cover image
I will be writing more about the process I use to get the image, which is hosted and stored by archive.org.
 Artist, Song Title, Release Title, Date of release and label
The process to retrieve the first release of the song being played cannot be explained in this page, so I am going to defer that for an entire series of posts and share code and stuff to give you more of detailed look at the inner workings and logic. For the laymen, the data is retrieved from an API provided by musicbrainz.org who have (IMHO) the most accurate collection of music in a single database. In fact, it is apparent that many of the service providers rely on musicbrainz to drive their applications. The metadata maintained by musicbrainz is handled by a large consortium of music enthusiasts, who I am proud to be a part of such a dynamic community of people.
 (if available) The instruments, and the artist playing it.
With many of the popular releases, additional metadata about a song (known as a recording), are available through the Musicbrainz API. Of that, the artists’ credits are often a very entertaining read, to learn more about that song. I only want the instruments, and vocals, but the API can provide all the credits, such as producers and engineers and the like.
 The list of songs on the release, in order.
It’s often handy to see the other songs which were on a release. For me, it gives me ideas for my playlists, and to remember back to the time I used to listen to a particular release when it first came out. This data is readily available through the API in a simple request.
 The Nerdly stats:
Total number of known titles in the database to date. The frequency and bitrate of the broadcast, service uptime and number of current listeners.
 Wikipedia data about the artist.
In most cases, the “Annotation” about the artist is linked to a WikiData object, which is then relative to the Wikipedia page that contains the output. Getting the extract content from wikipedia, I was able to truncate the content to a set of sentences, to prevent having a wall of text displayed.
 Wikipedia data about the release (if available)
Much in the same way the artist content is used, there is a wikidata object (on most but not all) release groups, and getting the content is very similar to that of getting the artists’ content, and truncated as well to prevent a wall of text.
 Song play history for the last 90 mins.
The song play history is a simple call to the ShoutCast server for the history, and it returns a string in Json format which is then populated in the history section. It’s function is merely to give me a look back at what’s been played – very helpful while I’m doing a live broadcast, to let me know if I’ve already played a particular song, so I can keep from repeating myself in my selection of music. I’ve been known to do that from time to time.