home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / dsp / dspgroup / sound.arc / SAMPRATE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-22  |  338 b   |  21 lines

  1. /* Set sampling rate */
  2. #define    IOBASE    0x300
  3. #define    CLOCK    6250000
  4. #define    DIVISOR    284
  5. main(argc,argv)
  6. int argc;
  7. char *argv[];
  8. {
  9.     short divisor;
  10.     long samprate,atol();
  11.  
  12.     samprate = atol(argv[1]);
  13.     divisor = CLOCK/samprate;
  14.     
  15.     outportb(IOBASE+7,0xb4);
  16.     outportb(IOBASE+6,divisor);
  17.     outportb(IOBASE+6,divisor >> 8);
  18. }
  19.  
  20.  
  21.