Hi Folks
I thought I had figured this out but obviously not! I simply want my C# program to play a specified sound clip and perform a system beep. The beep works great but I just can't get the wav file to play. Here's the code:
using System;
using System.IO;
using System.Windows.Forms;
using System.Runtime.InteropServices;
public class Win32 {
[DllImport("user32.dll"]
public static extern bool MessageBeep(uint soundtype);
}
public class Win32Beep
{
public static void Main()
{
string windir = "C:\\Media";
string soundfile = windir + "\\sound.wav";
Win32.MessageBeep(0);
File.Open(soundfile);
}
}
Any idea what I'm doing wrong? Obviously the File.Open is being used incorrectly but I'm stuck as to what to try instead.
Cheers,
Kenny.
I thought I had figured this out but obviously not! I simply want my C# program to play a specified sound clip and perform a system beep. The beep works great but I just can't get the wav file to play. Here's the code:
using System;
using System.IO;
using System.Windows.Forms;
using System.Runtime.InteropServices;
public class Win32 {
[DllImport("user32.dll"]
public static extern bool MessageBeep(uint soundtype);
}
public class Win32Beep
{
public static void Main()
{
string windir = "C:\\Media";
string soundfile = windir + "\\sound.wav";
Win32.MessageBeep(0);
File.Open(soundfile);
}
}
Any idea what I'm doing wrong? Obviously the File.Open is being used incorrectly but I'm stuck as to what to try instead.
Cheers,
Kenny.