views:

816

answers:

2

Hi, I have a MP3 file in my Resources of Visual C#. I'm trying to find out if there is a way I can play this MP3 in a Windows Media Player control or with MCI, I'm not particular. I'm fairly new to C#. Thanks!

A: 

This page shows you how in just a few lines of code:

http://www.crowsprogramming.com/archives/58

Hope this helps.

Edit: Be sure to copy the .mp3 to your bin before you run it.

And here is the source code. Be sure to add a reference to wmp.dll in your project.

WMPLib.WindowsMediaPlayer wmp = new WMPLib.WindowsMediaPlayer();
wmp.URL = "test.mp3";
wmp.controls.play();
Gary the Llama
A: 

Hi, this is a component for playing MP3 with C# on Windows Forms (it includes a demo app).

http://www.codeplex.com/keniamm/

hope this helps

Horacio N. Hdez.