This one is a very easy one as we only have to use the Windows Media Player control to play the streaming mp3 file. This is a very effective control and can be used to make complete media player as well. I have also used it in my Trizz Media Player project. This tutorial will also make use of the control.
Firstly, we add the control to our project. So right click on the left most control dialog (where your active x controls are) and click components. Then you will get a dialog like the picture below. Then scroll down to the bottom and check the widows media player option and click ok.
Firstly, we add the control to our project. So right click on the left most control dialog (where your active x controls are) and click components. Then you will get a dialog like the picture below. Then scroll down to the bottom and check the widows media player option and click ok.
Next, Add the windows media player control, a text box , a button to the form and place them as the picture below. You should rename the controls like : WMP,Text1,CMDPlay respectively. Now go to the code window or double click the command button to add the code which is given below the Picture.
Private Sub CMDPlay_Click()
WMP.URL = Text1
WMP.Controls.play
End Sub
WMP.URL = Text1
WMP.Controls.play
End Sub
Next Run the application, and enter any mp3 url in the text box then click the button, The media will play. Also I wont have to explain the code , its self explanatory.