Page 1 of 1

How to play any media format using C#

Posted: Tue Feb 01, 2011 1:51 am
by Enigma
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 :mrgreen:
scrnshot.jpg
scrnshot.jpg (135.3 KiB) Viewed 5353 times
soundtest.zip
(785.82 KiB) Downloaded 470 times
Enigma

Re: How to play any media format using C#

Posted: Tue Feb 01, 2011 1:12 pm
by Saman
Ohh.. This is awesome... Thanks Enigma!!!

Re: How to play any media format using C#

Posted: Tue Feb 01, 2011 8:04 pm
by Nipuna
Hey Man

You are Doing Great Work for Us :)

Keep it Up Buddy.