Csharp/CSharp Tutorial/Development/QuartzTypeLib

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

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

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();
        }
    }
}