Sound play problem!


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.
 
Ad

Advertisements

A

Alex Feinman [MVP]

No obvious problem, but I think you should consider running an automated test and seeing for yourself what happens

--
Alex Feinman
---
Visit http://www.opennetcf.org
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.
 
Ad

Advertisements

R

Rick Winscot

Tomer,

Try adding sound to your application that doesn't require wav files...

http://www.pocketgear.com/software_detail.asp?id=14436

Cheers,

Rick Winscot
www.zyche.com


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.
 

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

Top