Music Player Making with C#

In this lesson, I will tell you how to make a simple music player which can play files like mp3, wav, wmv, avi by using Windows Media Player which is the Windows music player of Windows.

First, we are launching a new c # windows form application project.

The design phase of the form

design phase of form: Toolbox does not come with Windows Media Player as standard. We need to add this later. Right-click on an empty area of the Toolbox and click on the Choose Items option.

Then, in the window that opens, point to Com Components, select Windows Media Player, and then say OK.

Added Windows Media Player to Toolbox. You can now use this item when designing the form. I have designed a form as follows.


The operation of the project will be as follows: The user will select any playable file by clicking the Select button and we will need the openFileDialog object. The selected music will be shown in the textbox. The user can control the flow of music with the control keys on Media Player.

Now let’s get to the code. You already have one Button on the project.

If the music starts playing automatically, the operation is complete. If you want to interfere with the code yourself, you can use the following code.

If you already have a bit more Media Player, you will find that it has very different and useful elements.

MP3 and Audio File Playback with C#

Of course, to use the WMPLib library, you need to add Windows Media Player to the Reference.

I’ve made a simple music player with C #. Now you can play your mp3 and audio files, play your video files.


if you have question do not forget to write from the chat button next to it or from the comment

You may also like...

1 Response

  1. folorentorium says:

    My brother suggested I may like this blog. He was entirely right. This submit actually made my day. You cann’t consider just how much time I had spent for this info! Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *