T
Tomer
Hi,
I've 4 ways to play a wav file:
[DllImport("CoreDll.DLL", EntryPoint="PlaySound", SetLastError=true)]
private extern static int WCE_PlaySound(string szSound, IntPtr hMod, int flags);
[DllImport("CoreDll.DLL", EntryPoint="PlaySound", SetLastError=true)]
private extern static int WCE_PlaySoundBytes (byte[] szSound, IntPtr hMod, int flags);
[DllImport("CoreDll.DLL", EntryPoint="PlaySoundW", SetLastError=true)]
private extern static int PlaySoundW(string szSound, int hMod, int flags);
[DllImport("CoreDll.DLL", CharSet=CharSet.Auto)]
public extern static bool sndPlaySound(string lpszSoundname, uint fuSound);
Up until now I've used this function, (provided with a filename first):
public void Play ()
{
// if a file name has been registered, call WCE_PlaySound,
// otherwise call WCE_PlaySoundBytes
if (m_fileName != null)
WCE_PlaySound(m_fileName, IntPtr.Zero, (int) (Flags.SND_ASYNC | Flags.SND_FILENAME));
else
WCE_PlaySoundBytes (m_soundBytes, IntPtr.Zero, (int) (Flags.SND_ASYNC | Flags.SND_MEMORY));
}
I have an application that plays a sound on each user input.
user input happens alot during the day (few thousands)
I got reports that this sound sometimes stops playing (about once or twice a day).
To solve this the user has to warm boot the pocket pc.
I still haven't tried using the other ways to play a sound, Should I use a different way to play a sound?
Whats the difference between the CoreDll.dll functions?
Tomer.
I've 4 ways to play a wav file:
[DllImport("CoreDll.DLL", EntryPoint="PlaySound", SetLastError=true)]
private extern static int WCE_PlaySound(string szSound, IntPtr hMod, int flags);
[DllImport("CoreDll.DLL", EntryPoint="PlaySound", SetLastError=true)]
private extern static int WCE_PlaySoundBytes (byte[] szSound, IntPtr hMod, int flags);
[DllImport("CoreDll.DLL", EntryPoint="PlaySoundW", SetLastError=true)]
private extern static int PlaySoundW(string szSound, int hMod, int flags);
[DllImport("CoreDll.DLL", CharSet=CharSet.Auto)]
public extern static bool sndPlaySound(string lpszSoundname, uint fuSound);
Up until now I've used this function, (provided with a filename first):
public void Play ()
{
// if a file name has been registered, call WCE_PlaySound,
// otherwise call WCE_PlaySoundBytes
if (m_fileName != null)
WCE_PlaySound(m_fileName, IntPtr.Zero, (int) (Flags.SND_ASYNC | Flags.SND_FILENAME));
else
WCE_PlaySoundBytes (m_soundBytes, IntPtr.Zero, (int) (Flags.SND_ASYNC | Flags.SND_MEMORY));
}
I have an application that plays a sound on each user input.
user input happens alot during the day (few thousands)
I got reports that this sound sometimes stops playing (about once or twice a day).
To solve this the user has to warm boot the pocket pc.
I still haven't tried using the other ways to play a sound, Should I use a different way to play a sound?
Whats the difference between the CoreDll.dll functions?
Tomer.