G
Guest
Hi,
I use the below code to play a wave file continously on a windows mobile 5.0
device.
i stop the playing of the wave file on press another button.
But after some time the WCE_PlaySound returns 1 but does not play the sound.
This continues for a few minutes.
During this time i cannot play any sound.
Can someone tell me why this is happening and how i can over come this
problem.
[DllImport("coredll.dll", EntryPoint = "PlaySound", SetLastError = true)]
public extern static int WCE_PlaySound(string szSound, IntPtr hMod, int
flags);
public static void PlaySound(string fileName)
{
if (fileName != null && fileName != "")
{
int iSuc = WCE_PlaySound(RingTone, IntPtr.Zero,
(int)(Flags.SND_ASYNC | Flags.SND_FILENAME | Flags.SND_LOOP));
if(iSuc == 0)
MessageBox.Show("Error");
}
}
public static void StopPlaySound(string File)
{
int SND_PURGE = 0x0040;
WCE_PlaySound(File, IntPtr.Zero, SND_PURGE);
}
Thanks in Advance,
Murthy
I use the below code to play a wave file continously on a windows mobile 5.0
device.
i stop the playing of the wave file on press another button.
But after some time the WCE_PlaySound returns 1 but does not play the sound.
This continues for a few minutes.
During this time i cannot play any sound.
Can someone tell me why this is happening and how i can over come this
problem.
[DllImport("coredll.dll", EntryPoint = "PlaySound", SetLastError = true)]
public extern static int WCE_PlaySound(string szSound, IntPtr hMod, int
flags);
public static void PlaySound(string fileName)
{
if (fileName != null && fileName != "")
{
int iSuc = WCE_PlaySound(RingTone, IntPtr.Zero,
(int)(Flags.SND_ASYNC | Flags.SND_FILENAME | Flags.SND_LOOP));
if(iSuc == 0)
MessageBox.Show("Error");
}
}
public static void StopPlaySound(string File)
{
int SND_PURGE = 0x0040;
WCE_PlaySound(File, IntPtr.Zero, SND_PURGE);
}
Thanks in Advance,
Murthy