IAN LANG ELECTRONICS

Visual Basic 2010

An Internet Radio Player

Go Back

When I first started doing electronics, radio was the usual gateway for beginners. You took a heap of  either valves or more commonly then transistors, some resistors and capacitors and lots of copper wire and de-soldered the circuit that you'd just made because it didn't work and remade it into one that did. Building radios was alternately very easy and very hard, depending on what you wanted to do. Except if you wanted to pick up Radio Moscow. Radio Moscow was very easy to pick up as it came through on all sorts. Even stuff that wasn't a radio.

 

Picking up foreign stations was known as DXing and there weren't many you could get. All were AM and most were on the long wave and subject to all sorts of atmospheric conditions. Radio has come a long way since then. Many broadcasters now have an accesible internet stream which comes through as an MP3 stream. Some of them (Radio 3) are better than FM quality. None of them are subject to noise caused by amplitude or phase interference. You still need to know how to make a receiver though.

 

And that's the rationale behind this article. I don't know whether this is a good thing or a bad thing. On the good side it means that radio is now available to everyone everywhere with an internet connection and in any language you like, with a great deal more choice and specialisation in channels. On the other, it's sad that all the old techniques you had to master to build succesful receivers are slowly being consigned to history as many of them stand you in good stead for making other things too. Then again, there's a whole range of new techniques to master to build a Windows receiver. Hmmm.

 

Well, I'll leave the question of whether it's a good thing or bad thing to the philosophers because the fact is that whether it's good or bad it is a thing that exists and as technical people and makers we need to do something about it. Ladles and Jellyspoons, we proudly(ish) present the internet radio player:

irppopulated

And as you can see it's got a clock on it as well. That clock is going to be important as it's got sleep timers and a radio alarm clock function too. (Ooooooooooooh!!!).

 

Up above you can see it's "tuned" to Classic FM which if you don't live in the UK is a station that broadcasts popular classical music. So, before we delve in to the design and coding, let's have a look at what it does. Here's the startup:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The red text is warning you that there's no list of stations to play. So let's chuck one in there:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Clicking on the Populate List menu item leads to this:

 

 

 

 

 

 

 

 

irpstart irppopulatemenu irpopenfile

On my computer I have a folder on the desktop called "Dump Bin" and where I stick all the stuff I want to find easily later on. Setups, datasheets, drawings, other interesting bits I find from time to time all go into a sub-folder in the dump bin. In this case the file that populates the station list is in a sub-folder called IRP as you can see at the top of the dialogue box there, and the file I want is stationlist IRP. I can either double-click on it or highlight it and click open, and when I do either the radio player reads the list and populates a list box with the station names. There's another list box which is never visible; that contains the relevant URL for the radio station concerned.

 

For those who don't know, a URL is a uniform resource locator and it gives the address of the internet location from where the stream is coming. Here's what the file looks like in the raw:

 

Classic FM

http://media-ice.musicradio.com/ClassicFMMP3.m3u

1

BBC Radio 4

http://www.bbc.co.uk/radio/listen/live/r4.asx

1

BBC Radio 3

http://www.bbc.co.uk/radio/listen/live/r3.asx

1

BBC Radio 2

http://www.bbc.co.uk/radio/listen/live/r2.asx

0

BBC Radio 1

http://www.bbc.co.uk/radio/listen/live/r1.asx

0

BBC Radio 4 Extra

http://www.bbc.co.uk/radio/listen/live/r4x.asx

1

BBC 5 Live

http://bbc.co.uk/radio/listen/live/r5l.asx

1

BBC World Service

mms://livewmstream-ws.bbc.co.uk.edgestreams.net/reflector:43021

1

BBC Radio Sheffield

http://wmlive-lracl.bbc.co.uk/wms/england/lrsheffield

0

French Radio London

http://audio1.ipercast.net/frenchradiolondon.com/hi/mp3.m3u

0

Radio Hallam

http://tx.whatson.com/icecast.php?i=hallam.mp3.m3u

0

Heat

http://tx.whatson.com/icecast.php?i=heat.mp3.m3u

0

Kerrang!

http://tx.whatson.com/icecast.php?i=kerrang.mp3.m3u

0

NDR Kultur (German)

http://www.ndr.de/resources/metadaten/audio/m3u/ndrkultur.m3u

1

M2 Classique (French)

http://www.m2radio.fr/pls/m2classic.m3u

0

RFI Monde (French)

http://www.tv-radio.com/station/rfimonde-mp3/rfimonde-mp3-64k.pls

0

B5 Aktuell (German)

http://streams.br-online.de/b5aktuell_2.m3u

0

Deutschlandfunk

http://www.dradio.de/streaming/dlf.asx

0

DRadio Wissen

http://www.dradio.de/streaming/dradiowissen.asx

0

 

 

There are in fact three pieces of data for each radio station. Let's break a couple down:

 

NDR Kultur (German)

http://www.ndr.de/resources/metadaten/audio/m3u/ndrkultur.m3u

1

 

First up is the station name which is NDR Kultur, a Hamburg station similar to Classic FM but in German, of course. The second line is the URL for the stream which always begins http:// and usually they have extensions at the end such as m3u or pls or asx which means they are an audio stream. The last line is either a zero or a one. This indicates whether or not the player should add it to the favourites box. NDR Kultur is added to the favourites box.

 

BBC Radio 1

http://www.bbc.co.uk/radio/listen/live/r1.asx

0

 

Radio 1 most certainly is not on my favourites list.

More >

If you want to build something like this or if you just want the URLS the station list is available as a text file that you can download here:

stationlist

Since March 2015 the BBC has moved its streams to Shoutcast MP3 format. The new URL list is here:

BBC Streams