home *** CD-ROM | disk | FTP | other *** search
- //┌───────────────────────────────────────────────────────────────────────┐//
- //│ │//
- //└───────────────────────────────────────────────────────────────────────┘//
- VOC_freqency()
- {
- FILE *fin
- VOCHDR VH;
- long type_size, size;
- char type, frequency;
- long freq;
- //.........................................................................
- freq = 0;
- if ((fin = fopen (input_file, "rb")) == NULL) show_error(2, input_file);
- if (fread (&VH, sizeof(VH), 1, fin) == 0) show_error(5, input_file);
- if (fseek (fin, VH.voice_offset, SEEK_SET) != 0) show_error(5, input_file);
- while (!feof(fin))
- {
- if (fread (&type_size, 4, 1, fin) == 0 && !feof(fin)) show_error(5, input_file);
- type = type_size & 0x000000FF;
- size = type_size >> 8;
- if (type == 0) break;
- if (feof(fin)) break;
- if (type == 1)
- {
- fread (&frequency, 1, 1, fin);
- freq = 1000000/(256-(unsigned char)frequency);
- break;
- }
- if (fseek (fin, size, SEEK_CUR) != 0) show_error (5, input_file);
- }
- fclose(fin);
- return;
- }
-
-
-