programmatically play mp3 files on windows w/C#.net

I'm looking for a simple, programmatic way to play brief (5 seconds or less) mp3 files. If possible, I'd like to avoid having to use 3rd-party commercial apps and tap into their API, though I wouldn't mind tapping into Windows Media Player if that's my only option. If there's a free 3rd party component that I could ship with my app, that would be ideal. Or if there's a way for .NET to natively do this, that would be ideal as well.

Looking for (1) Which I should use and (2) Basic sample code usage.
LVL 11
SweatCoderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

osmantemizCommented:
first of all you have to import winmm library:

            [DllImport("winmm.dll")]
            public static extern long PlaySound(String lpszName, long hModule, long      dwFlags);

then you can use PlaySound method whenever you want to play sounds...

                PlaySound("msg.wav",0,0);

afaik there is no .NET native way to do this.
0
SweatCoderAuthor Commented:
Your example was wav. Will it work with MP3?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.