home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / C / SOUND / DEMO.C < prev    next >
Text File  |  1993-12-01  |  2KB  |  46 lines

  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. /*  This is a demo program for the SOUNDPLAY function included in both
  5.     SPEAKTC.OBJ and SPEAKQC.OBJ.  I cant remember, but it might be necessary
  6.     to change the string.h include for Turbo-C 2.01 and earlier.  Try it
  7.     this way first.
  8.         David Hoelzer   Copyright (C) 1991, all rights reserved
  9. */
  10.  
  11.  
  12.  
  13. void SOUNDPLAY(char *, char, int);      /* Keep the compiler happy */
  14.  
  15. void main()
  16. {
  17.     char *titles[30]={"yoho.iff","destiny.voc","bop.snd","coffee.voc"};
  18.     char twiddles[4]={60,240,210,170};
  19.     int  delays[4]={40,45,34,16},x,delay,patchvalue;
  20.     char Filename[30],twiddle;
  21.  
  22.  
  23.     printf("This is a brief demonstration of the SOUNDPLAY routine.\n");
  24.     printf("The arguments are a SoundFileName, twiddle(to twiddle the values in\n");
  25.     printf("the file..  Not worth describing) and delay(Used for frequency.)\n");
  26.     printf("\n");
  27.     printf("Before we begin, this program was designed around a 6 MHz AT, so I\n");
  28.     printf("wouldn't be too surprised if your machine is a bit faster..  We need\n");
  29.     printf("to do some patching to make sure that the samples aren't too fast..\n");
  30.     printf("For an AT 6MHz the patch value is 0.  DO NOT USE A PATCH VALUE LESS\n");
  31.     printf("THAN -15!!!  If you need to, use splay.  For something slower, use a\n");
  32.     printf("negative number..  Faster use a positive..  I believe that the value\n");
  33.     printf("for a PS/2 50z is 30 to 35.  Experiment.\n\n");
  34.     printf("What is the patch value for this machine? ");
  35.     scanf("%i",&patchvalue);
  36.         for(x=0;x!=4;x++){
  37.         strcpy(Filename,titles[x]);
  38.         twiddle=twiddles[x];
  39.         delay=delays[x]+patchvalue;
  40.         printf("Now Playing %s.\n",Filename);
  41.         SOUNDPLAY(Filename, twiddle, delay);
  42.     }
  43. }
  44.  
  45.  
  46.