I just wondered how to make my program "beep". I saw someone
else do it in a console game. I want to be able to in my console
games too. Is there a function or something? Like Beep() or
MakeNoise()? That's all I want to know.
Compiler: Dev-Cpp 18.104.22.168
OS: Windows ME
That should give a beeping sound.
std::cout << '\a' << endl;
Thanks. I'm still open to any other ways to do the same thing.
EDIT: It still doesn't work, Hmmmm.
YET ANOTHER EDIT: None of my other programs that did make
beeps before work now, It's not your mothod, I just have something disabled. My speakers are on, so that's not it.
That \a thing has never worked for me, might be windows
that method is less simple then just Beep() and is sync, meaning it probably will be of no use for a game
Um.....how about use Beep(). That is in <windows.h>. It should work. Note the capitalization.
Won't including windows.h make me have to declare main as
? or can I just use
int WINAPI WinMain(HINSTANCE hthisin, HINSTANCE hprevin,
LPSTR cmdlin, int cmb)
good old main()?
Okay, I tryed it... What are the paramiters to Beep()? I says too few arguments...
check my link...
And as I said that is not suitable to games because it is not async.
Anyways, remember to include this
for most uses of windows.h
Okay, thanks. I'll check it out, I don't ghet why it's not good for a game, all I need it to
do is beep. Well, meybe not, but it will still work, for now.
Hmmm, well, I see what you mean. I was hoping for something alterable. I have windows
ME, so it gives me a windows beep, What is the point of accepting two args if it won't
do anything but one tone? Ferthermore, it will end a loop instantly.
Seems it would be easier to just emulate a PC speaker through a normal sound system. I've never done it before but I imagine you'd just produce a square wave and set the volume and duration of it. ;)
No idea. I'm trying to figure it out myself. :D
Ummmm...it would be easier to use DirectSound/Music. But that's probably too obvious so no one will do it.