Creating a Web Radio in VB.NET

Today, I will teach you how to create a web radio in vb.net. What is a web radio? I call it a web radio because this application has its radio to be played using the web. So now i will going to teach you how to do this. 1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application. 2. Right click the ToolBox, and click the Choose Items. output 3. Now, check the Windows Media Player in the COM components. output 3. Next, add the WindowsMediaPlayer component to the Form and insert one combobox as our radio channel. You must design your interface like this: output 4. Now, we will code for the Form_Load to load the items of our ComboBox.
  1. ComboBox1.Items.Add("One Love Hip Hop")
  2. ComboBox1.Items.Add("Just Hip Hop")
  3. ComboBox1.Items.Add("Electric FM")
  4. ComboBox1.Items.Add("Eurodance 90")
  5. ComboBox1.Items.Add("Gaia Radio")
  6. ComboBox1.Items.Add("202 Chill Out")
  7. ComboBox1.Items.Add("2000 FM Hard Rock")
Then, we will code for the changing of index in the combobox. This is to have the URL to be played in our media player. This is the code below that finds the radio station on the web and will serve as the URL to be played in the windows media player.
  1. Dim station As String
  2. If ComboBox1.SelectedIndex = 0 Then
  3. station = "http://www.windowsmedia.com/RadioTunerAPI/Service.asmx/playStation?stationID=2776c94c-7a4a-4fd9-afc7-bbe945f53124&dialupDetected=true&useHighBandwidth=false&locale=it-it"
  4.  
  5. ElseIf ComboBox1.SelectedIndex = 1 Then
  6. station = "http://www.windowsmedia.com/RadioTunerAPI/Service.asmx/playStation?stationID=153ea8a1-cb18-4106-8637-ed50521aae61&dialupDetected=true&useHighBandwidth=false&locale=it-it"
  7. ElseIf ComboBox1.SelectedIndex = 2 Then
  8. station = "http://www.windowsmedia.com/RadioTunerAPI/Service.asmx/playStation?stationID=1fd96794-dd9d-4602-a495-fa7fed164e0b&dialupDetected=true&useHighBandwidth=false&locale=it-it"
  9. ElseIf ComboBox1.SelectedIndex = 3 Then
  10. station = "http://www.windowsmedia.com/RadioTunerAPI/Service.asmx/playStation?stationID=cc5f3d9e-c75f-4065-b592-cddc1bc20bb4&dialupDetected=true&useHighBandwidth=false&locale=it-it"
  11. ElseIf ComboBox1.SelectedIndex = 4 Then
  12. station = "http://www.windowsmedia.com/RadioTunerAPI/Service.asmx/playStation?stationID=d4bcd49f-06f1-4c18-9c68-aa11731a0c11&dialupDetected=true&useHighBandwidth=false&locale=it-it"
  13. ElseIf ComboBox1.SelectedIndex = 5 Then
  14. station = "http://www.windowsmedia.com/RadioTunerAPI/Service.asmx/playStation?stationID=16f3c064-316c-4d37-b969-c004e53165df&dialupDetected=true&useHighBandwidth=false&locale=it-it"
  15. ElseIf ComboBox1.SelectedIndex = 6 Then
  16. station = "http://www.windowsmedia.com/RadioTunerAPI/Service.asmx/playStation?stationID=955aa0cd-872c-400c-8b4f-bffe19432e42&dialupDetected=true&useHighBandwidth=false&locale=it-it"
  17.  
  18. End If
  19. AxWindowsMediaPlayer1.URL = station
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below. Best Regards, Engr. Lyndon Bermoy IT Instructor/System Developer/Android Developer/Freelance Programmer Mobile: 09488225971 Landline: 826-9296 E-mail:[email protected] Add and Follow me on Facebook: https://www.facebook.com/donzzsky Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

Add new comment