Play a sound file

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

Hai Ly Hoang

In my application, i want to play a piece of music (wav or mp3). How to do
it ?
 
Hi,

You have to P?Invoke :

[DllImport("winmm.dll")]
public static extern int sndPlaySound(string lpszSoundName , int uFlags)

[DllImport("user32.dll")]
private static extern bool MessageBeep(int type);

Take a look at thos functions in the Windows API

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top