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

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    83

    Question Guru challenge (seriously!): beep in Win7 64bit

    Hi gurus,

    I just switched to Win7 Ultimate edition 64bit and now the beep functionality via internal speaker (system speaker on motherboard) does not work anymore.

    The reason is described here (basically M$ trying to clean up their code): http://blogs.msdn.com/b/larryosterma...windows-7.aspx

    I used "Console.Beep(a,b)" to notify me that a process has ended.

    Any ideas how to send some kind of acoustic signal through the internal speaker (any loud noise would do for my purposes).

    Thanks and enjoy cracking that nut...

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Guru challenge (seriously!): beep in Win7 64bit

    Hey Beamer, long time no see

    I am by no means a guru, won't ever be, but I usually do not back down at any challenge...

    Well, as it turns out, there is absolutely no solution to this. The only workaround may be to aquire desktop speakers, or headphones and use the MessageBeep API, or System.Audio to play a sound through the desktop speakers, or headphones.

  3. #3
    Join Date
    Aug 2006
    Posts
    83

    Question Re: Guru challenge (seriously!): beep in Win7 64bit

    Hi Hannes, good to see you too!!!

    I hope your reply will not scare anybody else away from this challenge! What makes you so sure that there is now way? Personally I think that there must be some kind of trick, because the speaker itself is connected and produces sound on boot up.

    I would also be willing to direct all audio signals to the internal speaker as a standard setting if I knew how to do that, hoping that this would redirect my beep to the internal speaker...

  4. #4
    Join Date
    Jun 2004
    Location
    NH
    Posts
    678

    Re: Guru challenge (seriously!): beep in Win7 64bit

    This is a problem I came across too, but I have been able to make sound with the api.
    Although, it is really choppy-poppy on 64 bit systems. On some machines it may not work at all, although I have not seen this.
    The proper audio driver may be important as well, and this is very hard to get right on 64 bit systems, even if the sound seems to work fine, it may not be perfect.

    This is the declaration I use.
    Code:
      Private Declare Function apiBeep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Int32, ByVal dwDuration As Int32) As Int32
    I thought I read that the issue was resolved, but it sounds terrible.
    I actually never checked to see if the sound was re-routed to the external speakers, or if it really invokes the internal speaker.
    For Windows 7, we resolved the issue completely – we moved all the functionality that used to be contained in Beep.Sys into the user mode system sounds agent – now when you call the Beep() API instead of manipulating the 8254 chip the call is re-routed into a user mode agent which actually plays the sounds.
    Try it yourself, and make sure the driver is perfect.
    The driver on CD usually is the best, and make sure the bios setting for integrated audio is toggled correctly.
    Be sure to elevate as administrator, or turn off UAC when installing the driver. Some require the UAC to be off, otherwise it will say it installed correctly, but in reality it did not.

    [EDIT]: this api plays syncronously, so if you call it to quickly it may ignore the call, or cue it up, causing sluggish response until finished.
    Last edited by TT(n); March 18th, 2011 at 09:15 AM.

  5. #5
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Guru challenge (seriously!): beep in Win7 64bit

    This is a good thread. I didn't know about this issue at all. I just have one question though..

    Is all this really really needed just for a beep sound, Just to attract attention to the user? Why not use Something like FlashWindow or such like ? Surely Beep doesn't need gto be so important.

    I am stupid, so I am just trying to get my head around this.

    Hannes

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Guru challenge (seriously!): beep in Win7 64bit

    If I mute my sound, because of something important, it better not BEEP when I get a high-score, or something like that!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Aug 2006
    Posts
    83

    Re: Guru challenge (seriously!): beep in Win7 64bit

    Quote Originally Posted by HanneSThEGreaT View Post
    This is a good thread. I didn't know about this issue at all. I just have one question though..

    Is all this really really needed just for a beep sound, Just to attract attention to the user? Why not use Something like FlashWindow or such like ? Surely Beep doesn't need gto be so important.

    I am stupid, so I am just trying to get my head around this.

    Hannes
    Hannes,

    stupid is only the one who doesn't ask.

    There are several reasons for making this important:
    1. As written in the linked article there is software for disabled people that uses the internal speaker.
    2. What do you do if you don't have an external sound system, but want your software to give acoustic signals (i.e. you have a server and/or no monitor connected)?
    3. In my case I have 2 PCs and #1 is plugged into the sound system while #2 is running my software that crunches numbers for quite a while. When it's finished I hear a beep and don't need to turn on or watch the monitor. I might also be in the next room and don't want to check the progress every few minutes.

    Making more sense now?

  8. #8
    Join Date
    Jan 2010
    Posts
    1,133

    Re: Guru challenge (seriously!): beep in Win7 64bit

    Who doesn't have external speakers today? Unless the hardware is corporate property and no extra/unrequired... (unrequired?) equipment was allowed?

  9. #9
    Join Date
    Aug 2006
    Posts
    83

    Question Re: Guru challenge (seriously!): beep in Win7 64bit

    I don't mean to be rude, but this was meant to be a discussion about how to enable the internal speaker, not whether or not (and why) to have external speakers or needing the internal one. If you are interested in the latter please read either my post or the link in the initial post.

    So any ideas on the original topic?

  10. #10
    Join Date
    Jun 2004
    Location
    NH
    Posts
    678

    Re: Guru challenge (seriously!): beep in Win7 64bit

    Have you tried to replace the Beep.sys file with an xp one?

    I read that you can do this, and two people allegedly had success.
    http://www.windowsreference.com/wind...-to-old-style/

    My windows 7 drive is on the fritz(what a surprise), and I did not have any luck with this method.
    At least it seems to be on the right track inside the device manager.

    I assume you know how to take ownership of a file, but if not it's pretty easy.

  11. #11
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Guru challenge (seriously!): beep in Win7 64bit

    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  12. #12
    Join Date
    Aug 2006
    Posts
    83

    Re: Guru challenge (seriously!): beep in Win7 64bit

    What's the point of reposting the link from my initial post???

  13. #13
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Guru challenge (seriously!): beep in Win7 64bit

    Very very interesting reading indeed! TT(n) I wish I had just a quarter of your magnificent brain!

  14. #14
    Join Date
    Jun 2004
    Location
    NH
    Posts
    678

    Re: Guru challenge (seriously!): beep in Win7 64bit

    Well Hannes, considering I learned a large amount from you over the years, you need not be so humble.

  15. #15
    Join Date
    Jan 2014
    Posts
    1

    Re: Guru challenge (seriously!): beep in Win7 64bit

    Hi all Gurus,
    I know this is an old thread, and I am new trying to play with beep.sys and not so knowledgeable about drivers.
    I have a program that I need to work with (unfortunately I cannot change it...), and I need to hear an alarm that is driven by beep.sys into my bluetooth headset (right now in Windows 8, I hear it in the laptop speakers, and a very low ticking-like sound in the headset).

    My pc is running on Windows 8.1, and I have tried all tricks and advices above (Larry's method, trying to start a second beep service wit beepxp.sys (ref solution found here: http://www.waldbauer.com/tmp/reference.php?).

    At the end, I was always able to get the new beep.sys file to be used, but all I got from these solutions is that the alarm would not even ring in the notebook speakers anymore. So I am back to beginning.

    I read that this could be an issue with delay for processing sounds, but I just don't know what to do to check that and do some testing...

    Help!!!

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured