Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main() {
- FILE *fr = fopen("input.wav", "r");
- fseek(fr, 0, SEEK_END);
- long int file_size = ftell(fr);
- fseek(fr, 0, SEEK_CUR);
- char *data = malloc(file_size);
- fread(data, file_size, 1, fr);
- char *startDataBlock = strstr(data, "data");
- unsigned int block_size = *((unsigned int*)(startDataBlock + 4));
- for (int i = 0; i < block_size; i += 2) {
- short value = *((short *) (startDataBlock + 8 + i));
- value *= 1.25;
- *((short *) (startDataBlock + 8 + i)) = value;
- }
- FILE *fw = fopen("output.wav", "wb");
- fwrite(data, file_size, 1, fw);
- fclose(fw);
- fclose(fr);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement