views:

359

answers:

2

My application needs to beep when validation fails so the user (who may be several feet away) may hear it. I'd like to use the Console.Beep() but this is unavailable in a x64 environment (see the remarks). There may or may not be speakers in/at the computer, so I can't use System.Media.SystemSounds.Beep.Play().

The current target platform is a x86 environment, but I'd like to have the ability for the application to run in x64 also.

Is there a way to do this or should I just give up?

Edit: Added link to the method.

+3  A: 

Beep has been removed as a native function from all x64 platforms (so no managed version of course), there is a connect issue that petition to return it.

We use a different trick to discover servers, we remote eject the dvd drive, and the drive with the tray open is the one were looking for :)

[EDIT]
Larry Osterman has a great article about this: What's up with the beep driver in Windows 7

Shay Erlichmen
So there's no way to force a Beep in a x64 platform?
Stevoni
looks like it, there might be a 3rd party beep driver out there but i could not find one.
Shay Erlichmen
A: 

Playing one of the standard windows sounds might be a better approach. The following article shows how (it only takes a couple lines):

http://msdn.microsoft.com/en-us/library/4y171b18%28VS.100%29.aspx

If you wanted to stay within theme, you could check the windows registry for the current sound scheme, and play the appropriate sound to fit your need.

jrista
I don't know whether the machine that will be used will have a speaker or wont be muted (like my machine) otherwise this would be a good fit.
Stevoni
Coming from the users perspective, if I don't have the option of muting annoying application sounds, I'd be pretty frustrated. I would call having the option a HUGE bonus for the user. Its a bad idea to try and control what a user hears and what pops up on the users screen. Microsoft has spent years fine tuning those capabilities to give users the utmost control of annoying things like that.
jrista
This is a request from the user. They were complaining that they couldn't hear when there had been an error in the previous version. Now that I've been tasked with updating, I need to accommodate those issues.
Stevoni
But I completely agree, that's why I have my computers always muted unless I'm watching something.
Stevoni