home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
C
/
SOUND
/
DEMO.C
< prev
next >
Wrap
Text File
|
1993-12-01
|
2KB
|
46 lines
#include<stdio.h>
#include<string.h>
/* This is a demo program for the SOUNDPLAY function included in both
SPEAKTC.OBJ and SPEAKQC.OBJ. I cant remember, but it might be necessary
to change the string.h include for Turbo-C 2.01 and earlier. Try it
this way first.
David Hoelzer Copyright (C) 1991, all rights reserved
*/
void SOUNDPLAY(char *, char, int); /* Keep the compiler happy */
void main()
{
char *titles[30]={"yoho.iff","destiny.voc","bop.snd","coffee.voc"};
char twiddles[4]={60,240,210,170};
int delays[4]={40,45,34,16},x,delay,patchvalue;
char Filename[30],twiddle;
printf("This is a brief demonstration of the SOUNDPLAY routine.\n");
printf("The arguments are a SoundFileName, twiddle(to twiddle the values in\n");
printf("the file.. Not worth describing) and delay(Used for frequency.)\n");
printf("\n");
printf("Before we begin, this program was designed around a 6 MHz AT, so I\n");
printf("wouldn't be too surprised if your machine is a bit faster.. We need\n");
printf("to do some patching to make sure that the samples aren't too fast..\n");
printf("For an AT 6MHz the patch value is 0. DO NOT USE A PATCH VALUE LESS\n");
printf("THAN -15!!! If you need to, use splay. For something slower, use a\n");
printf("negative number.. Faster use a positive.. I believe that the value\n");
printf("for a PS/2 50z is 30 to 35. Experiment.\n\n");
printf("What is the patch value for this machine? ");
scanf("%i",&patchvalue);
for(x=0;x!=4;x++){
strcpy(Filename,titles[x]);
twiddle=twiddles[x];
delay=delays[x]+patchvalue;
printf("Now Playing %s.\n",Filename);
SOUNDPLAY(Filename, twiddle, delay);
}
}