struct fmt {
unsigned short stereo; /* 1 = pcm, 2 = adpcm */
unsigned short channels; /* number of channels */
- unsigned long sample_rate; /* sample rate */
- unsigned long data_rate; /* data rate */
+ unsigned int sample_rate; /* sample rate */
+ unsigned int data_rate; /* data rate */
unsigned short bytes_sample; /* bytes per sample (all channels) */
unsigned short bits_sample; /* bits per sample (one channel) */
};
unsigned char buffer[256];
struct fmt fmt;
FILE *lfp;
- unsigned long i;
+ unsigned int i;
short sample;
- unsigned long size, wsize;
+ unsigned int size, wsize;
if ((lfp=fopen(name,"r")))
{
/* get size */
fseek(lfp, 0, SEEK_END);
size = ftell(lfp);
- printf("samples: %ld\n", size);
+ printf("samples: %d\n", size);
size += size;
fseek(lfp, 0, SEEK_SET);
fprintf(fp, "WAVE");
/* fmt */
- fprintf(fp, "fmt %c%c%c%c", sizeof(fmt), 0, 0, 0);
+ fprintf(fp, "fmt %c%c%c%c", (unsigned int)sizeof(fmt), 0, 0, 0);
fmt.stereo = 1;
fmt.channels = 1;
fmt.sample_rate = 8000;