Music Player using Microsoft Multimedia Control in VB6

In this article, we will create a program that can play music using the Microsoft Multimedia Control 6.0. Now, let's start this tutorial! 1.Let's start this tutorial by following the following steps in Microsoft Visual Basic 6.0: Open Microsoft Visual Basic 6.0, click Choose Standard EXE, and click Open. 2.Go to Project Tab, and Click Components or Press Ctrl+T. 3. In the Controls Tab, find and Microsoft Multimedia Control 6.0, Microsoft Windows Common Controls 6.0 (SP6), and Microsoft Common Dialog Control 6.0. Click apply and then click OK. 4. Next, insert two Buttons named cmdSearch labeled it as "Search" that will be used for searching songs, and cmdPlay labeled it as "Play" for playing the desired music that has been played. Add also Label named Label1 for displaying the filename of the song. Insert also the slider from the toolbox, CommonDialog named CommonDialog1, and MMControl named MMControl1. You must design your interface like this: design 5. Now put this code for your code module.
  1. Private Sub cmdPlay_Click()
  2. If (cmdPlay.Caption = "Play") Then
  3. MMControl1.Command = "Open"
  4. MMControl1.Command = "Play"
  5. cmdPlay.Captiay.Caption = "Stop") Then
  6. MMControl1.Command = "Close"
  7. cmdPlay.Caption = "Play"
  8. End If
  9. End Sub
  10.  
  11. Private Sub cmdSearch_Click()
  12. CommonDialog1.ShowOpen
  13. MMControl1.FileName = CommonDialog1.FileName
  14. Label1.Caption = CommonDialog1.FileName
  15. End Sub
  16.  
  17.  
  18. Private Sub MMControl1_StatusUpdate()
  19. Slider1.Max = MMControl1.Length
  20. Slider1.Value = MMControl1.Position
  21. End Sub

Explanation:

We used Microsoft Common Dialog Control 6.0 for browsing the song when clicking search button, Microsoft Windows Common Controls 6.0 (SP6) for the slider, and Microsoft Multimedia Control 6.0 for playing the searched song. In the cmdSearch button, we used the CommonDialog control to open the desired file to play music. The chosen filename for songs will be in the MMControl and the Filename will display in Label1. In the cmdPlay button, we used the MMControl command such as Play and Stop. Once the caption for cmdPlay is "Play" then it is stopped, otherwise, it is played when the caption is "Stop". Once the song has been played in the Microsoft Multimedia Control, then it passed in the slider to adjust the song or the position where it was played.

Output:

outputoutput Download the source code below and try it! :) For more inquiries just contact my number or e-mail below. Best Regards, Engr. Lyndon R. Bermoy IT Instructor/System Developer/Android Developer Mobile: 09488225971 Telephone: 826-9296 E-mail:[email protected] Follow and add me in my Facebook Account: https://www.facebook.com/donzzsky Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

Comments

Submitted bykrushna bhonde (not verified)on Thu, 03/05/2015 - 16:46

the macromedia is very good subject.

Add new comment