la sound() fa emettere dei suoni allo speaker, però da sola non la smette più.
per usarla devi:
1. chiamarla passando come argomento il valore intero relativo alla
frequenza da far emettere allo speaker
2. aspettare il tempo necessario (quanto vuoi che si senta il suono)
chiamando la delay() (a cui devi passare il tempo in millisecondi)
3. fermare l'emissione del suono da parte dello speaker con nosound()
Ti riporto il codice dell'esempio del Borland (guarda pure il commento :gren: :gren: :gren: )
codice:
/* Emits a 7-Hz tone for 10 seconds.
True story: 7 Hz is the resonant
frequency of a chicken's skull cavity.
This was determined empirically in
Australia, where a new factory
generating 7-Hz tones was located too
close to a chicken ranch: When the
factory started up, all the chickens
died.
Your PC may not be able to emit a 7-Hz tone. */
#include <dos.h>
int main(void)
{
sound(7);
delay(10000);
nosound();
return 0;
}