NOISE

Page created by Netrex
Main page
Privacy & security
Online test
Port list
C++
Soft
Downloads
GPS
News
Guest book
Photos
Online games
ICQ# 219-370-918

My ICQ status is

E-mail to me

Rambler's Top100 Rambler's Top100

Программа NOISE. Ничего особенного. просто обычное шипение PC SPEAKER-а.

СКАЧАТЬ!!!

Назад к оглавлению

#include <conio.h>
#include <dos.h>
#include <stdio.h>
#include <bios.h>
#include <stdlib.h>
#include <time.h>

main()
{
int handle,key,intrpt,freq;
textmode(C40);
textattr(10);
cprintf("This programm produces a random stream\r\nof bits and play it.\r\nTo change frequency use UP and DOWN\r\narrows.\r\nTo set a delay between the generating\r\nbits use RIGHT and LEFT arrows.\r\n\nPress any key to start.\r\n\n");
getch();
cprintf("Initializing generator of random\r\ndigits...");
randomize();
cprintf("DONE\n\n\r\aSetting values of variables...\r\n");
key=1;
intrpt=0;
freq=1000;
cprintf("delay=%dms\r\nfrequency=%dHz\r\nDONE\r\n\n\agenerating bits>>>\r\n\nPress ESC to stop>>>\r\n\nStatus: in progress...\r\n",intrpt,freq);

while (key!=283)  //повторять до нажатия ESC
     {
     if (bioskey(1)!=0)
          {
          key=bioskey(0);
          switch (key)  //изменение звука
               {
               case 18432: freq+=100;  //изменение частоты
               cprintf("\r \rfrequency set to %d Hz",freq);
               break;

               case 20480: if (freq>=100) freq-=100;
               cprintf("\r \rfrequency set to %d Hz",freq);
               break;

               case 19712: intrpt+=1 //изменение задержки
               cprintf("\r \rdelay set to %d ms",intrpt);
               break;

               case 19200: if (intrpt>=1) intrpt-=1;
               cprintf("\r \rdelay set to %d ms",intrpt);
               break;

               case 283: cprintf("\r \rEXIT\a");  //выход
               break;


               default: cprintf("\nWrong entry");

               }

          }
     handle=random(2);
     if (handle==0)  //не писщать
          {
          nosound();
          delay(intrpt);
          //cprintf("0");
          }
     if (handle!=0)  //писщать
          {
          sound(freq);
          delay(intrpt);
          //cprintf("1");
          }
     }
nosound();
return 1;
}

Hosted by uCoz