Reputation: 569
When I tried Console.Beep()
on Win Vista (64bit), it just does not work. The speaker itself is OK, when the PC starts, it beeps.
Any advice? Thanks!
Upvotes: 6
Views: 5330
Reputation: 57159
As others have suggested, the Console.Beep()
does not work on 64 bit windows as the documentation states. Instead, you can use the following statement that issues a beep (but not through the Beep API):
// beep
System.Media.SystemSounds.Beep.Play();
Workaround originally found here at MSDN Connect.
Upvotes: 1
Reputation: 127543
As everyone else has posted pc speaker Beep is not supported in 64x of windows vista or XP and not at all in windows 7. Here is a blog posting from Microsoft explaining why
Upvotes: 2
Reputation: 55009
Is it 64 bit Vista?
Console.Beep calls the API function Beep which isn't supported on 64bit Vista.
Quote: Windows Vista x64 and Windows XP 64-Bit Edition: This function is not supported.
You might be able to use MessageBeep instead if it's ok with the beep coming through the speakers instead of straight from the motherboard. See here for how to call this from C#.
Upvotes: 10
Reputation: 1092
the Beep method is not supported on Vista/XP x64. I suppose you do have 64-bit OS?
Upvotes: 2