can someone please provice me simple code to just play audio files (specially .ogg) using this library. i don't want any other feature.
thanks in advance.
mihir
Depending on the way you would like to build the application here is one way you can do it. Remember you'll have to add references to the 4 .dll files which come with libvlcnet. You'll also need to have the libvlc.zip file in the same directory as your program executable. If you are using Visual Studio you can add it as an existing item to your project and then direct it to copy to the program directory on build.
using DZ.MediaPlayer.IO;
using DZ.MediaPlayer.Vlc.WindowsForms;
VlcPlayerControl vlcPlayerControl = new VlcPlayerControl();
vlcPlayerControl.Initialize();
vlcPlayerControl.Visible = false;
// Note the second parameter is a string which represents the path to the file you want to play.
// The easiest way to feed this parameter in is with an OpenFileDialog, in which case you could
// use: openFileDialog.FileName after you've opened the file dialog and selected the file you want
// to play.
MediaInput input = new MediaInput(MediaInputType.File, "path to the file you want to play as a string");
vlcPlayerControl.Play( input );
That about all there is to it. Of course the above code is VERY simplistic. As it is above it would only open one file and start playing immediately and then stop when
it reached the end of the file. Obviously if you were including this as part of a Form application you could add various controls such as buttons to Pause, Play, Stop
the file using the various methods of the VlcMediaPlayer.
Hopefully this makes sense to you. If you need a little more detailed explanation let me know.