using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX.DirectSound;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
string filename = @"D:/Project/Study2008/WindowsFormsApplication1/bin/Debug/phone.mp3";
Device device = new Device();
device.SetCooperativeLevel(this, CooperativeLevel.Priority);
SecondaryBuffer buffer = new SecondaryBuffer(filename, device);
buffer.Play(0, BufferPlayFlags.Looping);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}