Csharp/CSharp Tutorial/Development/QuartzTypeLib
Версия от 15:31, 26 мая 2010; (обсуждение)
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();
}
}
}