play a piece of music

  • Thread starter Thread starter Hai Ly Hoang
  • Start date Start date
H

Hai Ly Hoang

I want to play a piece of music in .NET application
How to do that ?
Thanks a lot !
 
I've created a very basic program in C#
but for some reason it doesn't run but runs the debugger instead:
As described in the SDK documentation your program is supposed to work
exactly as mine but yours works and mine doesn't.
Here is the code.
private Device dsDevice = null;
SecondaryBuffer buffer;
BufferDescription info;
public Form1()
{

dsDevice = new Device();
dsDevice.SetCooperativeLevel(this,CooperativeLevel.Priority);
info=new BufferDescription();
info.ControlFrequency=true;
Info.ControlPan=true;
info.ControlVolume=true;
buffer=new SecondaryBuffer("Chord.wav",info,dsDevice);

buffer.Play(0,BufferPlayFlags.Default);

Can anyone tell me what's the problem?
THanks a lot!
 
Back
Top