Community discussion forum
Make the PC beep
-
This thread is for discussions of Make the PC beep.
-
Advertisement
Simply the fastest line-level profiler for .NET ever
“The low overhead means it has minimal impact on the execution of my program”
Mark Everest, Development Team Leader, Renault F1 Team Ltd.Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now
-
Hi,
I'm merely a N00b in VB-programming...
I tried docmd.beep for beeping on errors and such.
But as you said, this only works when there's a soundcard installed ánd speakers attached.
I tried to use your beep code, but I just can't seem to get it right.
declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
beep 500 1000
could U specify what comes where ?
(inside function, new function... ?)
Tha in Adva -
hey dzjowk,
i had the same problem. i figured it out. simply place the declare function .... line in your program declarations. it is not declared as a separate funciton. here's my code:
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Command1_Click()
Beep 500, 100
End Sub -
Tha a Lot Palley!
-
huh? is this english?
-
I've made it a hobby of mine making up my own english...
Sowwy d00d -
The recommended "kernel32" function didn't work for me (source below). Notes: VB.Net, Visual Studio, XP Pro. Every hardware and software sound setting is PEGGED and unmuted (in case you were thinking of asking).
???s
* The beep() doc goes on and on about UIPermissions; any advice/thoughts here? If this were the issue I would think it would throw a runtime error, which it doesn't. Try/Catch caught nothing.
* Numerous of the "sound profile" settings in XP's setup are set to nothing. Does beep() use one of these (which)?
Any help appreciated.
=PDG=
Public Class Form1
Inherits System.Windows.Forms.FormRegion " Windows Form Designer generated code "
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub btnBeep_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBeep.Click
Beep(500, 1000)
MsgBox("Did the beep thing")
End Sub
End Class -
I know just enough of VB to be dangerous. I am not a software engineer by any means. I can tell you this code runs on windows NT, 98, and XP boxes just fine (at least the way i did it). Also, I wrote it using VB 6.
i would suggest opening a new .exe and just putting the command button in with just my source. i am not at all familiar with your instring declarations.
sorry i couldn't help more. -
Thanks anyway. I'm also relatively new to VB. I think that this is a ".Net" issue and I'm sure your code works with VB6. All the "instring" stuff you note is generated by VB.Net; this is, as you suggest, just a form with a button that is supposed to beep. Thanks again.
-
As it turns out out this is a widely known problem once you know what to look for. It is the result of uninstalling Norton Anti-Virus; it deletes "Default Beep" for the current user. A variety of solutions are apparently available; I chose what appeared to be the most idiot-proof:
1) Create a new user (assuming you have admin auth)
2) As new user run regedit.
3) Expand HKEYCURRENTUSER
4) Right click on HKEYCURRENTUSER\AppEvents
5) Export as somefilename.reg
6) Log off new user and back on as original user
7) Double click somefilename.reg
8) Answer 'yes" to the prompt.
That's it; no re-boot or anything. -
Are there values to control the interval between beeps and to control the volume of the beep?
Thanks,
David. -
I coded a simple program that makes different tones, the programs runs fine on users with windows xp, but it gives the same tone all the time with ppl running Windows 98, what can I do to give em all the tones

-
i am trying get a sound out of the internal pc speaker for 2 days and i am still trying. i have win 98, i consider myself prety advanced in vb language
. i searched more on google. i found a driver for pc speaker. it still didn't work
. i downloaded a program that said that it makes the internal speaker beep, but no, it made the same visual basic beep. whatever frequency or how many miliseconds i set for the beep its still makes the vb beep through my headphones.
can someone pls answer these problems? -
Is it possible to make VB create two tones at the same time?
-
Hi,
I have successfully get the beep sound out. However, how to display a form and then only the beep sound? Currently the beep sound is out before the form is displayed.Where should I put the this line : Beep 500, 9000 ?? If I were to put inside the form, then it will call the sound even before the form is displayed. Please advice.
Thanks.
-
Hi my names chris barbour <bobjamin> and im new on this site but im far from new at programming ive programmed for about 6 or 7 years now and im 17 years old. I started with visual basic then moved to c++ and now i use C#, C# is a mixture between the two languages, it has the power of c++ and the simpleness of vb. about a month ago i realised you could use the beep function in vb to send a frequency and duration to the internal beeper and so naturally i played about with that. in C# the syntax is simple(Console.Beep(frequency,duration))and there is also a sleep function (System.threading.thread.Sleep(duration)), i used these to create a piano machine, it basically displays a piano onscreen with inputs for tempo,length of beat,file name and file path. every time you press a button it plays the corresponding beeps frequency.If the record checkbox is pressed then it writes to a file every notes length,frequency,starting position and ending position.Then if you click on left hand it alows you to write the left hand notes.Now when you press play it reads each file seperately and because you cant play two notes together it looks for the notes the cut each other at a point and it seperates them so it sounds like two notes are being played. This only really works for fast songs like fantasy impromptu which i think i put with the zip file(which i cant send here for some reason, if you want it email me at bobjamin@aol.com ill send you it free) because when long notes are played can then another note comes in it just stops. For that reason im trying to work with midis<if anyone can help please do,ive been trying to use the winmm.dll library but ive had no luck sounding anything> If i cant get that to work then im goin to work on a program that allows you to use the internal speaker like a normal speaker by sending 1 millisecond pulses at the right frequency to act like two simultaneos waves coming together. I can convert from visual basic easily so if you could send me anything that would help me get the midi situation sorted out then please send me it.
thanx!
Post a reply
Quick links
Recent activity
- qwe qwe replied to we search the company in I...
- Konstantin Kovshenin replied to Can't seem to submit a blog
- Barry Roberts replied to connecting to a database
- MOHAMMED SEIDU replied to How to Export Datagridview ...
- MOHAMMED SEIDU replied to How to Export Datagridview ...
- Alexis Méndez replied to how to select item to datag...
Enter your message below
Sign in or Join us (it's free).