views:

111

answers:

2

I want to create audible feedback to the user to signal success or failure of data validation. Playing the system Asterisk and Exclamation sounds seem to be the proper way to do this, especially since the device may have non-standard sounds configured.

The problem is that System.Media is not available in the .NET Compact Framework 2.0 to play them.

What alternative ways do I have to play these system sounds?

A: 
using System.Runtime.InteropServices;

[DllImport(”winmm.dll”)]

private static extern bool PlaySound( string filename, int module, int flags );

PlaySound(Application.StartupPath + "/test.wav",0,SND_ASYNC);

There is a whole article on this here

Molex
He said `System.Media` is not available in the compact framework 2.0..
Zenuka
Seems to be in CF 3.5, bad luck I guess :X
OregonGhost
oops, didn't notice that
Molex
made some changes...
Molex
A: 

I've been down this road. The PlaySound API (which uses CoreDll.DLL acutally) is about the only option you have.

I had a static class for this, but the results weren't loud enough and ended replacing it with code that used the Symbol.Audio classes (symbol bar code scanner).

Robert H.