Mail Archives: djgpp/1999/06/23/09:37:00
On Tue, 22 Jun 1999 20:03:00 -0500, paradise AT computerpro DOT com wrote:
>hmm...
>
>The problem I'm having with sound( ) and nosound( ) and delay( ) is that I
>don't know the syntax of what goes in ( ).
>
>In replace of sound( int _Frequency)
>ie. sound(A5)?????????? or something??????
>anyone know what I mean
>
>
>
>
>C++
>
>
>
>
>
>Steven Taylor wrote:
>
>> > The library reference on sound says the syntax is:
>> > ------------------------------------------------
>> > #include <pc.h>
>> >
>> > void sound(int _frequency);
>> > ------------------------------------------------
>> > _frequency being a number for the tone, I guess.
>> >
>> > I keep getting errors when compiling.
>> > I don't think I'm putting these lines in my code properly.
>> >
>> > Help!!!
>> oh dear. If you're getting a linker error, then you haven't installed DJGPP
>> properly. If you're getting a compiler error, you either haven't read the
>> docs properly or you need to learn how to program in C or C++.
>
sound() starts the speaker oscillating at a specific frequency
specified by _frequency (an integer). Frequencies between 250hz and
1500hz make useful sounds; way back when I had a sheet that listed
various notes and their frequencies (middle C, etc).
You would make a call like
sound(1000);
to start a 1Khz tone and some time later,
nosound();
to turn it off. If you are doing anything complex at all between
sound() and nosound(), you might want to create a program that
consists only of a call to nosound() so that if your program crashes
you can shut the sound off before you go bonkers. :-)
- Raw text -