How to play any media format using C#
Posted: Tue Feb 01, 2011 1:51 am
Hi
In .net most of the time you use SoundPlayer class to play media content. But what if you want to play a mp3 file or video file?? This code shows how to play any media format using C#. I’m using a library called “Quatrz.dll”. This is a very powerful library which is powered by Direct Show. You can find this library in C:\Windows\System32 directory. All you have to do is open up the VS and create a new project. In the solution explorer, right click on the Reference-> Add Reference -> Go to “Browse” tab and give the Quatrz.dll path. (in C:\Windows\System32\ Quatrz.dll ).
I have commented the code. Guys please note that I couldn’t test this thoroughly. So this may have bugs.
Hope this will help you
Enigma
In .net most of the time you use SoundPlayer class to play media content. But what if you want to play a mp3 file or video file?? This code shows how to play any media format using C#. I’m using a library called “Quatrz.dll”. This is a very powerful library which is powered by Direct Show. You can find this library in C:\Windows\System32 directory. All you have to do is open up the VS and create a new project. In the solution explorer, right click on the Reference-> Add Reference -> Go to “Browse” tab and give the Quatrz.dll path. (in C:\Windows\System32\ Quatrz.dll ).
I have commented the code. Guys please note that I couldn’t test this thoroughly. So this may have bugs.
Hope this will help you

Enigma