How do you get a short wav sound to play at a certain time?
Like if some one types in a number and hits enter it beeps.
In QB it was easy
lolCode:CLS BEEP End
How do you get a short wav sound to play at a certain time?
Like if some one types in a number and hits enter it beeps.
In QB it was easy
lolCode:CLS BEEP End
What is C++?
this is the way i do it.. it is non-std i think.
sound()/nosound()/delay() - all in dos.h
Code:--- --- cout<<"enter sound value [Hz] : "; cin>>sval; cout<<"enter play duration [Sec] : ": cin>>dur sound(num); delay(dur); nosound(); --- ---
...or if you want just a beep sound use --> cout<<"\a";
Last edited by ihsir; 05-09-2002 at 11:43 PM.
-
Is there a list of these "\" commands?
All I know are:
\n, \t, and now \a
What is C++?
HELP IS THE BEST PLACE...
Find it in ur IDE.
-Sriharsha.
Help everyone you can
here are what i know...
\a : bell-beep
\b : backspace
\f : formfeed
\n : newline-linefeed
\r : carriage return
\t : horizontal tab
\v : vertical tab
\\ : backslash
\' : single quote
\" : double quote
\0 : NULL
-
why doesn't \a work for me?
It's supposed to beep right?
I still don't get how that would make a beep...
btw: I'm using Dev-C++ 4.0
Then try the SOUND()/DELAY()/and NOSOUND() function combination only.
Sriharsha.
Help everyone you can
cout<<"BEEP!!! \a";
that gets he wav "bep" from your windows current sound scheme. You might have that sound disabled.
What is C++?
Originally posted by Vicious
cout<<"BEEP!!! \a";
that gets the wav "beep" or "ding" from your windows current sound scheme. You might have that sound disabled.
What is C++?
Well those are not exactly wav sounds. The beep is just Windows catching your beep which prob activates an interrupt and Windows has a handler there. Instead of the default beep, it plays the beep sound for your sound scheme. They just converted the system beep into something else. In pure DOS, that will still just beep the PC speaker.
To actually play wav files you must load them, mix them if needed into a final sample, and then play them via the sound card.
For info:
http://www.cae.wisc.edu/~brodskye//
http://developer.creative.com/LEFTME..._Downloads.asp
Im goin wit wat he said...
Im new here but I know always go with what bubba says.
What is C++?