1

I'd like to make a quick and dirty simple media player in .NET. I have no idea how I may play music, pause, etc. I want to support ogg, mp3 and if possible mp4.

How do I actually playback the sound? Min requirements: Play, pause/resume, stop supporting mp3 and ogg (vorbis)

Brad
  • 159,648
  • 54
  • 349
  • 530
  • This is a very broad question. Are you trying to use codecs? Access the sound card? Or, do you not care about those details and just want to build a media player? If the latter, I suggest using libVLC. – Brad Jul 22 '13 at 03:25
  • @Brad: Make that an answer and mention libvlcnet http://sourceforge.net/projects/libvlcnet/?source=dlp and 200 rep may be yours 7 days from now –  Jul 22 '13 at 03:55

3 Answers3

5

Since you need to support a variety of codecs, I recommend libVLC. It's what powers VLC, and can handle just about any codec and playback option you can imagine. There are a few .NET wrappers available:

You could also ditch the fancy wrapper, and call functions via straight-up imports. If you don't need all the abstraction, this may be the way to go.

See these related StackOverflow posts:

I recently had a project where I simply executed VLC in the background, receiving it's output via STDIO. For what I was going, this was easier, as my command to VLC was fire-and-forget.

Community
  • 1
  • 1
Brad
  • 159,648
  • 54
  • 349
  • 530
1

NAudio is an excellent open-source library for .Net that you can use to play MP3 files. NVorbis can be used to play .ogg files.

Davide Castronovo
  • 1,366
  • 8
  • 21
MusiGenesis
  • 74,184
  • 40
  • 190
  • 334
0

For playing ogg file you can try oggsharp it is written in pure C# without any external dependencies.

For MP4 you should go with directshow

Davide Castronovo
  • 1,366
  • 8
  • 21
Eden
  • 3,696
  • 2
  • 24
  • 24