SIGN UP MEMBER LOGIN:    
ARTICLE

Reuse MMControl to Play Music File in New Framework 4

Posted by Tanmay Sarkar Articles | .NET 4.5 September 21, 2010
In this article you will learn how to Reuse MMControl to play Music File in new framework 4.
Reader Level:
Download Files:
 

We can Play Mp3, Mpeg, Wav, and Wma Music File with MMControl [Microsoft Multimedia Control]

It's come with Visual Studio 6. Now in this article we see how we reuse this file with Visual studio 2010 in C# 4.0

The original file is placed in C:\Windows\system32\MCI 32.OCX , First we browse it for our project.

First we create a tab in toolbox in this example I create "Import VS6" tab, then Right Click on it & select chose Item.

image1.gif

A box will open chose COM Components & browse MCI32.ocx from C:\Windows\system32

image2.gif

& after loading it looks like,

image3.gif

Then the tool box get the control,

image4.gif

Now add the Control in your from, it looks like previous one (VS 6),

image5.gif

Set the properties of control, visible =false (if you write your own command button) like almost VB add the command to play music file as,

private void button1_Click(object sender, EventArgs e)
        {
            axMMControl1.Command = "close";
            axMMControl1.FileName = textBox1.Text;
            axMMControl1.Command = "open";
            axMMControl1.Command = "play";
        }


And now in can play not only wav sound but also, mp3, mpeg, wav, wma.

Finally it looks like

image6.gif

Few notes: If you have no MCI32.OCX, don't worry I upload here the entire essential file. You can play music also using other older windows dll file & new code which come from direct .net , that's it.

Thank you.
 

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor