ralphtrent
Programmer
Hello
I am trying to play a sound on my windows mobile device. here is my code.
I have found the following pInvoke code to call to the CoreDll.dll file which I am able to put into my code and build successfully
I call this by calling
The sound is never heard. I Have verified the file (lstrWavePath) is legit and when I debug line by line, i never fail. Any idea's?
Thanks,
RalphTrent
I am trying to play a sound on my windows mobile device. here is my code.
I have found the following pInvoke code to call to the CoreDll.dll file which I am able to put into my code and build successfully
Code:
private enum SND
{
SYNC = 0x0000,
ASYNC = 0x0001,
NODEFAULT = 0x0002,
MEMORY = 0x0004,
LOOP = 0x0008,
NOSTOP = 0x0010,
NOWAIT = 0x00002000,
ALIAS = 0x00010000,
ALIAS_ID = 0x00110000,
FILENAME = 0x00020000,
RESOURCE = 0x00040004
}
[DllImport("CoreDll.dll", EntryPoint = "PlaySound", SetLastError = true)]
private extern static int PlaySound(string szSound, IntPtr hMod, int flags);
public static void PlaySound(string fileName)
{
try
{
PlaySound(fileName, IntPtr.Zero, (int)(SND.SYNC | SND.FILENAME));
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
I call this by calling
Code:
PlaySound(lstrWavePath);
The sound is never heard. I Have verified the file (lstrWavePath) is legit and when I debug line by line, i never fail. Any idea's?
Thanks,
RalphTrent