How to play an mp3 file from a C # program without adding any dependencies?

In a C # program, I want to allow users to specify a sound file (wav or mp3) that will play on a specific event.

I can use with a WAV file SoundPlayer, but, unfortunately, it cannot play anything else (for example, MP3).

Now I am looking for a way to play an audio file - wav or mp3 - without adding any dependencies.

Embedding WMP will work, but some people will be removed, in which case it will fail. In addition, I think I will have to add an additional DLL file, and I really want to save my application as a single exe file without any additional materials.

+3
source share
2

exe , ILMerge ( : NuGenUnify). , exe.

+2

.NET MP3-/. MP3 DirectShow, DirectSound ( DirectX) MCI (Media Control Interface), MCI .

, (, MP3 ) . , .exe.

, ManifestResouceStream.

+1

All Articles