dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: Beep Function

  1. #1
    Join Date
    Mar 2010
    Posts
    28

    Beep Function

    Hello,

    I set the frequency to 700 and time to 1000ms, like this:

    Code:
     Beep(700, 1000);
    But I can't hear the beeping sound on my laptop. Why is it? My laptop is Sony Vaio. Do laptops have internal speaker?

    Thanks!

  2. #2
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Beep Function

    What is Beep? I don't think that's a winapi, nor std C/C++ call.

  3. #3
    Join Date
    Mar 2010
    Posts
    28

    Re: Beep Function

    It's a WINAPI function. Read here: http://msdn.microsoft.com/en-us/libr...77(VS.85).aspx

  4. #4
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Beep Function

    Beep's output comes from system's internal speaker, which is generally on motherboards. Not all mother boards have this. The sound will not come from normal speakers. You can use PlaySound API instead.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  5. #5
    Join Date
    Aug 2008
    Posts
    902

    Re: Beep Function

    Ajay Vijay: Don't be so sure about that.

    In Windows 7 Beep is actually played thought the system sound output. You can in fact mute or lower the volume.

    Isn't very clean though. I imagine it's not used for much.

  6. #6
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Beep Function

    MSDN says:
    Muting and volume control have no effect on Beep; you will still hear the tone. To silence the tone, use the following commands:


    net stop beep
    sc config beep start= disabled

    Terminal Services: The beep is redirected to the client.
    Windows Me/98/95: On computers with a sound card, the function plays the default sound event. On computers without a sound card, the function plays the standard system beep.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  7. #7
    Join Date
    Aug 2008
    Posts
    902

    Re: Beep Function

    Quote Originally Posted by Ajay Vijay View Post
    MSDN says:
    I read that too. Seems to be outdated. My guess it it had changed in either Vista or 7. Beep() on my computer actually plays a tone of x frequency for y duration through the sound system (in this case my headphones) thought it is kinda gritty as there is a noticeable pop every time Beep is called.
    Last edited by Chris_F; May 14th, 2010 at 03:19 PM.

  8. #8
    Join Date
    May 2005
    Posts
    4,954

    Re: Beep Function

    Quote Originally Posted by MagniB View Post
    Hello,

    I set the frequency to 700 and time to 1000ms, like this:

    Code:
     Beep(700, 1000);
    But I can't hear the beeping sound on my laptop. Why is it? My laptop is Sony Vaio. Do laptops have internal speaker?

    Thanks!
    One thing you can try is open command line (run->cmd) and enter:
    Code:
    c:\>net start beep
    it should enable the beep if it disabled.

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  9. #9
    Join Date
    Aug 2010
    Posts
    51

    Smile Re: Beep Function

    hi,

    My Laptop(Sony Vaio) i can't hear beep voice. Pl. tell to why it is not hearing a beeping?
    will suggest to more information. I hope to soon reply


    thanks in advance

    regards,
    phe9oxis,
    http://www.guidebuddha.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)