Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
.NET Framework GroupsView
.NET Distributed_Apps
.NET
.NET ADO.NET
.NET ASP.NET
.NET ASP.NET Security
.NET ASP.NET Webcontrols
.NET ASP.NET Web Services
.NET Clr
.NET Compact Framework
.NET Drawing
.NET Interop
.NET Performance
.NET Web Services
.NET Windows Forms
.NET Windows Forms Controls
.NET General
.NET Csharp
.NET Visual Basic
.NET Vc
.NET Security
.NET Xml
Vsnet Debugging
Xml
Xsl
Scripting Jscript
Scripting Visual Basicscript
Scripting Wsh
Smartphone Developer
Visual Basic Com
Visual Basic Controls
Visual Basic Crystal
Visual Basic Database Ado
Visual Basic Syntax
Visual Basic Winapi
Vc Atl
Vc Debugger
Vc Language
Vc Mfc
Vc Stl
Visio Developer Visual Basica
Windowsce Embedded Vc
Windows Powershell
Visual Basic Vista Compatibility
Deployment Server
.NET Micro Porting

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Apps
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft NET General Posts  Ask A New Question 

Why Console.Beep() doen't beep?

Rafae posted on Saturday, February 09, 2008 11:07 PM

I'm studying C# (I've been a VB developer).

I'm making some tests and I need to use Console.Beep(), but it doesn't make
any sound, no matter if I try it in VS2008 beta or VS2005.

Could anybody tell my some hint abouit it?

--
Rafael
reply

 

Rafael,There is not any difference in using classes from Net between Visual

Cor Ligthert[MVP] posted on Sunday, February 10, 2008 1:27 AM

Rafael,

There is not any difference in using classes from Net between Visual Basic
and C#.

The only difference is the program language around that.

So probably there is something else.

Cor
reply

Console.

Mick Doherty posted on Sunday, February 10, 2008 6:21 AM

Console.Beep uses the PC Speaker rather than the soundcard (the same speaker
that the BIOS uses).
Do you have a PC Speaker?

Console.Beep(); is the equivelant of calling the Interop Beep method:
\\\
Beep(800, 200);
///
...where the method is defined as:
\\\
[DllImport("kernel32.dll")]
private static extern int Beep(int dwFreq, int dwDuration);
///


The MessageBeep Interop function plays a Wave sound through the soundcard.
There is no need to use MessageBeep via Interop, just use:
\\\
System.Media.SystemSounds.Beep.Play();
///

--
Mick Doherty
http://www.dotnetrix.co.uk/nothing.html
reply

I don't know why it doesn't beep,you might try this function

Sergey Zyuzin posted on Sunday, February 10, 2008 10:43 AM

I don't know why it doesn't beep,
you might try this function instead:

[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern bool MessageBeep(int type);


HTH,
Sergey Zyuzin
reply

Thank you Mick!!

Rafae posted on Sunday, February 10, 2008 2:23 PM

Thank you Mick!!

System.Media.SystemSounds.Beep.Play(); worked just fine. Although I wonder
why Console.Beep(); doesn't beep, there must be some configuration that I
haven't set, or something...

--
Rafael
reply

Hi Rafael,As I stated, Beep uses the PC Speaker, which is attached to the

Mick Doherty posted on Monday, February 11, 2008 5:19 AM

Hi Rafael,

As I stated, Beep uses the PC Speaker, which is attached to the motherboard
(mainboard),
whereas, MessageBeep plays a wave sound through the soundcard. So
Console.Beep() will only sound if you have a PC Speaker attached to the
motherboard.

If you have a PC Speaker then it may have been disabled.
http://www.computerhope.com/issues/ch000725.htm

--
Mick Doherty
http://www.dotnetrix.co.uk/nothing.html
reply

Thank you Mick!

RafaelSoteld posted on Wednesday, February 13, 2008 8:58 AM

Thank you Mick!

I checked in the device manager and the non plug and play Beep device was
not disable, although there's another thing with Motherboard cable that I
have to check.

Again, thank!

--

Rafael Soteldo
reply


Previous Microsoft NET General conversation.