Jump to content
  • Advertisement
Sign in to follow this  
kc_0045

making computer beep?

This topic is 5059 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
this is my favorite "scare the shit out of a newb" snippet:


#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
cout << "Warning: Proceeding will cause major system failure!\n";
for(int i = 0; i < 1500; i++)
Beep(i, 6);
MessageBox(NULL, "Your system is fried!", "KABLAM!", 0);
return 0;
}



hope you likey! HARHARHARHAR!

Share this post


Link to post
Share on other sites
A system beep is actually an ASCII character. I forget what the value is, but you can access it by using the escape character \a. So outputting a \a to cout will cause a system beep.

Share this post


Link to post
Share on other sites
That has really no application, i woudlnt waste any time figureing that one out, go use openAL or something, its an elegant API, and its something that will still be useful to you later on...

plus, i would bet money you need to do some major backflips in order to modulate the sound of the beeps

-Dan

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!