Use QuartzTypeLib to play Media file: wav, mp3, mp2, wma : QuartzTypeLib « Development « C# / CSharp Tutorial






using System;
using System.Windows.Forms;
using QuartzTypeLib;

public class MainClass
{
    public static void Main() {
        OpenFileDialog openFileDialog = new OpenFileDialog();
        openFileDialog.Filter = "Media Files|*.wav;*.mp3;*.mp2;*.wma|All Files|*.*";

        if (DialogResult.OK == openFileDialog.ShowDialog())
        {
            QuartzTypeLib.FilgraphManager graphManager = new QuartzTypeLib.FilgraphManager();
            QuartzTypeLib.IMediaControl mc = (QuartzTypeLib.IMediaControl)graphManager;

            mc.RenderFile(openFileDialog.FileName);

            mc.Run();
        }
    }
}








14.35.QuartzTypeLib
14.35.1.Use QuartzTypeLib to play Media file: wav, mp3, mp2, wma